Skip to content

Commit 6d99f31

Browse files
committed
Merge branch 'jz/apply-3way-first-message-fix'
When we swapped the order of --3way fallback, we forgot to adjust the message we give when the first method fails and the second method is attempted (which used to be "direct application failed hence we try 3way", now it is the other way around). * jz/apply-3way-first-message-fix: apply: adjust messages to account for --3way changes
2 parents 6e08cbd + 526705f commit 6d99f31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apply.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,7 @@ static int try_threeway(struct apply_state *state,
35703570
read_blob_object(&buf, &pre_oid, patch->old_mode))
35713571
return error(_("repository lacks the necessary blob to perform 3-way merge."));
35723572

3573-
if (state->apply_verbosity > verbosity_silent)
3573+
if (state->apply_verbosity > verbosity_silent && patch->direct_to_threeway)
35743574
fprintf(stderr, _("Performing three-way merge...\n"));
35753575

35763576
img = strbuf_detach(&buf, &len);
@@ -3637,6 +3637,10 @@ static int apply_data(struct apply_state *state, struct patch *patch,
36373637
return -1;
36383638

36393639
if (!state->threeway || try_threeway(state, &image, patch, st, ce) < 0) {
3640+
if (state->apply_verbosity > verbosity_silent &&
3641+
state->threeway && !patch->direct_to_threeway)
3642+
fprintf(stderr, _("Falling back to direct application...\n"));
3643+
36403644
/* Note: with --reject, apply_fragments() returns 0 */
36413645
if (patch->direct_to_threeway || apply_fragments(state, &image, patch) < 0)
36423646
return -1;

0 commit comments

Comments
 (0)