@@ -3570,10 +3570,10 @@ static int try_threeway(struct apply_state *state,
3570
3570
write_object_file ("" , 0 , blob_type , & pre_oid );
3571
3571
else if (get_oid (patch -> old_oid_prefix , & pre_oid ) ||
3572
3572
read_blob_object (& buf , & pre_oid , patch -> old_mode ))
3573
- return error (_ ("repository lacks the necessary blob to fall back on 3-way merge." ));
3573
+ return error (_ ("repository lacks the necessary blob to do 3-way merge." ));
3574
3574
3575
3575
if (state -> apply_verbosity > verbosity_silent )
3576
- fprintf (stderr , _ ("Falling back to three-way merge...\n" ));
3576
+ fprintf (stderr , _ ("Doing three-way merge...\n" ));
3577
3577
3578
3578
img = strbuf_detach (& buf , & len );
3579
3579
prepare_image (& tmp_image , img , len , 1 );
@@ -3605,7 +3605,7 @@ static int try_threeway(struct apply_state *state,
3605
3605
if (status < 0 ) {
3606
3606
if (state -> apply_verbosity > verbosity_silent )
3607
3607
fprintf (stderr ,
3608
- _ ("Failed to fall back on three-way merge...\n" ));
3608
+ _ ("Failed to do three-way merge...\n" ));
3609
3609
return status ;
3610
3610
}
3611
3611
@@ -3638,10 +3638,9 @@ static int apply_data(struct apply_state *state, struct patch *patch,
3638
3638
if (load_preimage (state , & image , patch , st , ce ) < 0 )
3639
3639
return -1 ;
3640
3640
3641
- if (patch -> direct_to_threeway ||
3642
- apply_fragments (state , & image , patch ) < 0 ) {
3641
+ if (!state -> threeway || try_threeway (state , & image , patch , st , ce ) < 0 ) {
3643
3642
/* Note: with --reject, apply_fragments() returns 0 */
3644
- if (! state -> threeway || try_threeway (state , & image , patch , st , ce ) < 0 )
3643
+ if (patch -> direct_to_threeway || apply_fragments (state , & image , patch ) < 0 )
3645
3644
return -1 ;
3646
3645
}
3647
3646
patch -> result = image .buf ;
@@ -5018,7 +5017,7 @@ int apply_parse_options(int argc, const char **argv,
5018
5017
OPT_BOOL (0 , "apply" , force_apply ,
5019
5018
N_ ("also apply the patch (use with --stat/--summary/--check)" )),
5020
5019
OPT_BOOL ('3' , "3way" , & state -> threeway ,
5021
- N_ ( "attempt three-way merge if a patch does not apply " )),
5020
+ N_ ( "attempt three-way merge, fall back on normal patch if that fails " )),
5022
5021
OPT_FILENAME (0 , "build-fake-ancestor" , & state -> fake_ancestor ,
5023
5022
N_ ("build a temporary index based on embedded index information" )),
5024
5023
/* Think twice before adding "--nul" synonym to this */
0 commit comments