File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ impl PrepareFetch {
143143 repo. config
144144 . resolved
145145 . string ( crate :: config:: tree:: Init :: DEFAULT_BRANCH )
146- . and_then ( |name| name. to_str ( ) . ok ( ) . map ( |s| format ! ( "refs/heads/{}" , s ) ) )
146+ . and_then ( |name| name. to_str ( ) . ok ( ) . map ( |s| format ! ( "refs/heads/{s}" ) ) )
147147 } )
148148 . unwrap_or_else ( || "refs/heads/main" . to_string ( ) ) ;
149149
Original file line number Diff line number Diff line change @@ -104,15 +104,9 @@ mod blocking_io {
104104
105105 // The refspec should be for a single branch (main), not a wildcard
106106 let refspec_str = refspecs[ 0 ] . to_str ( ) . expect ( "valid utf8" ) ;
107- assert ! (
108- !refspec_str. contains( "*" ) ,
109- "shallow clone refspec should not use wildcard: {}" ,
110- refspec_str
111- ) ;
112- assert ! (
113- refspec_str. contains( "refs/heads/main" ) ,
114- "shallow clone refspec should reference the main branch: {}" ,
115- refspec_str
107+ assert_eq ! (
108+ refspec_str, "+refs/heads/main:refs/remotes/origin/main" ,
109+ "shallow clone refspec should not use wildcard and should be the main branch: {refspec_str}"
116110 ) ;
117111
118112 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments