File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,6 @@ impl Context {
104
104
return Ok ( commit) ;
105
105
}
106
106
107
- let git_ref = match self . config . channel {
108
- Channel :: Nightly => "refs/heads/master" ,
109
- Channel :: Beta => "refs/heads/beta" ,
110
- Channel :: Stable => "refs/heads/stable" ,
111
- } ;
112
-
113
107
// git2 requires a git repository to be able to connect to a remote and fetch metadata, so
114
108
// this creates an empty repository in a temporary directory. It will be deleted once the
115
109
// function returns.
@@ -119,6 +113,12 @@ impl Context {
119
113
let mut remote = repo. remote ( "origin" , & self . config . repository ) ?;
120
114
remote. connect ( git2:: Direction :: Fetch ) ?;
121
115
116
+ let git_ref = match self . config . channel {
117
+ Channel :: Nightly => format ! ( "refs/heads/{}" , remote. default_branch( ) ?. as_str( ) . unwrap( ) ) ,
118
+ Channel :: Beta => "refs/heads/beta" . to_string ( ) ,
119
+ Channel :: Stable => "refs/heads/stable" . to_string ( ) ,
120
+ } ;
121
+
122
122
for head in remote. list ( ) ? {
123
123
if head. name ( ) == git_ref {
124
124
return Ok ( hex:: encode ( head. oid ( ) . as_bytes ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments