Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Zhang <jerry@skydio.com>2021-04-29 05:35:03 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-29 06:27:45 +0300
commit526705fd3d14a38646a12235ee385dcc0ffc7321 (patch)
treee773cfa7c37f74dfc7b3ed5ab6b110d94369e707 /apply.c
parent923cd87ac8550a8e277bfeb19198a11b6a8ed854 (diff)
apply: adjust messages to account for --3way changes
"git apply" specifically calls out when it is falling back to 3way merge application. Since the order changed to preferring 3way and falling back to direct application, continue that behavior by printing whenever 3way fails and git has to fall back. Signed-off-by: Jerry Zhang <jerry@skydio.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 69197268cc..5027aa0bb3 100644
--- a/apply.c
+++ b/apply.c
@@ -3572,7 +3572,7 @@ static int try_threeway(struct apply_state *state,
read_blob_object(&buf, &pre_oid, patch->old_mode))
return error(_("repository lacks the necessary blob to perform 3-way merge."));
- if (state->apply_verbosity > verbosity_silent)
+ if (state->apply_verbosity > verbosity_silent && patch->direct_to_threeway)
fprintf(stderr, _("Performing three-way merge...\n"));
img = strbuf_detach(&buf, &len);
@@ -3639,6 +3639,10 @@ static int apply_data(struct apply_state *state, struct patch *patch,
return -1;
if (!state->threeway || try_threeway(state, &image, patch, st, ce) < 0) {
+ if (state->apply_verbosity > verbosity_silent &&
+ state->threeway && !patch->direct_to_threeway)
+ fprintf(stderr, _("Falling back to direct application...\n"));
+
/* Note: with --reject, apply_fragments() returns 0 */
if (patch->direct_to_threeway || apply_fragments(state, &image, patch) < 0)
return -1;