File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -799,13 +799,17 @@ pub fn fetch(
799
799
refspecs. push ( String :: from ( "HEAD:refs/remotes/origin/HEAD" ) ) ;
800
800
}
801
801
802
- // For `rev` dependencies we don't know what the rev will point to. To
803
- // handle this situation we fetch all branches and tags, and then we
804
- // pray it's somewhere in there.
805
- GitReference :: Rev ( _) => {
806
- refspecs. push ( String :: from ( "refs/heads/*:refs/remotes/origin/*" ) ) ;
807
- refspecs. push ( String :: from ( "HEAD:refs/remotes/origin/HEAD" ) ) ;
808
- tags = true ;
802
+ GitReference :: Rev ( rev) => {
803
+ if rev. starts_with ( "refs/" ) {
804
+ refspecs. push ( format ! ( "{0}:{0}" , rev) ) ;
805
+ } else {
806
+ // We don't know what the rev will point to. To handle this
807
+ // situation we fetch all branches and tags, and then we pray
808
+ // it's somewhere in there.
809
+ refspecs. push ( String :: from ( "refs/heads/*:refs/remotes/origin/*" ) ) ;
810
+ refspecs. push ( String :: from ( "HEAD:refs/remotes/origin/HEAD" ) ) ;
811
+ tags = true ;
812
+ }
809
813
}
810
814
}
811
815
You can’t perform that action at this time.
0 commit comments