@@ -33,7 +33,7 @@ fn baseline() {
3333 Ok ( res) => match ( res. is_ok ( ) , err_code == 0 ) {
3434 ( true , true ) | ( false , false ) => { }
3535 _ => {
36- eprintln ! ( "{res:? } {err_code } {} {:?}" , kind. as_bstr( ) , spec. as_bstr( ) ) ;
36+ eprintln ! ( "{err_code } {res:? } {} {:?}" , kind. as_bstr( ) , spec. as_bstr( ) ) ;
3737 mismatch += 1 ;
3838 }
3939 } ,
@@ -59,7 +59,6 @@ mod invalid {
5959
6060 #[ test]
6161 fn empty ( ) {
62- assert ! ( matches!( try_parse( "" , Operation :: Fetch ) . unwrap_err( ) , Error :: Empty ) ) ;
6362 assert ! ( matches!( try_parse( "" , Operation :: Push ) . unwrap_err( ) , Error :: Empty ) ) ;
6463 }
6564
@@ -142,19 +141,15 @@ mod fetch {
142141 }
143142
144143 #[ test]
145- fn colon_alone_is_for_fetching_into_fetchhead ( ) {
146- assert_parse (
147- ":" ,
148- Instruction :: Fetch ( Fetch :: AllMatchingBranches {
149- allow_non_fast_forward : false ,
150- } ) ,
151- ) ;
152- assert_parse (
153- "+:" ,
154- Instruction :: Fetch ( Fetch :: AllMatchingBranches {
155- allow_non_fast_forward : true ,
156- } ) ,
157- ) ;
144+ fn colon_alone_is_for_fetching_head_into_fetchhead ( ) {
145+ assert_parse ( ":" , Instruction :: Fetch ( Fetch :: Only { src : b ( "HEAD" ) } ) ) ;
146+ let spec = assert_parse ( "+:" , Instruction :: Fetch ( Fetch :: Only { src : b ( "HEAD" ) } ) ) ;
147+ assert_eq ! ( spec. mode( ) , Mode :: Force , "it's set even though it's not useful" ) ;
148+ }
149+
150+ #[ test]
151+ fn empty_refspec_is_enough_for_fetching_head_into_fetchhead ( ) {
152+ assert_parse ( "" , Instruction :: Fetch ( Fetch :: Only { src : b ( "HEAD" ) } ) ) ;
158153 }
159154}
160155
0 commit comments