@@ -33,7 +33,7 @@ fn baseline() {
33
33
Ok ( res) => match ( res. is_ok ( ) , err_code == 0 ) {
34
34
( true , true ) | ( false , false ) => { }
35
35
_ => {
36
- eprintln ! ( "{res:? } {err_code } {} {:?}" , kind. as_bstr( ) , spec. as_bstr( ) ) ;
36
+ eprintln ! ( "{err_code } {res:? } {} {:?}" , kind. as_bstr( ) , spec. as_bstr( ) ) ;
37
37
mismatch += 1 ;
38
38
}
39
39
} ,
@@ -59,7 +59,6 @@ mod invalid {
59
59
60
60
#[ test]
61
61
fn empty ( ) {
62
- assert ! ( matches!( try_parse( "" , Operation :: Fetch ) . unwrap_err( ) , Error :: Empty ) ) ;
63
62
assert ! ( matches!( try_parse( "" , Operation :: Push ) . unwrap_err( ) , Error :: Empty ) ) ;
64
63
}
65
64
@@ -142,19 +141,15 @@ mod fetch {
142
141
}
143
142
144
143
#[ 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" ) } ) ) ;
158
153
}
159
154
}
160
155
0 commit comments