diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-02-17 02:14:29 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-17 02:14:29 +0300 |
commit | 90b7153806af46ca62b85a92a2810015be2453d4 (patch) | |
tree | d901ce92dd17d06fe7d0728dd1c25f29d4b37e98 /builtin/checkout.c | |
parent | 34230514b83f55ea0f4531e8486533ac5c3e2ffe (diff) | |
parent | 0dec322d31db3920872f43bdd2a7ddd282a5be67 (diff) |
Merge branch 'en/remerge-diff'
"git log --remerge-diff" shows the difference from mechanical merge
result and the result that is actually recorded in a merge commit.
* en/remerge-diff:
diff-merges: avoid history simplifications when diffing merges
merge-ort: mark conflict/warning messages from inner merges as omittable
show, log: include conflict/warning messages in --remerge-diff headers
diff: add ability to insert additional headers for paths
merge-ort: format messages slightly different for use in headers
merge-ort: mark a few more conflict messages as omittable
merge-ort: capture and print ll-merge warnings in our preferred fashion
ll-merge: make callers responsible for showing warnings
log: clean unneeded objects during `log --remerge-diff`
show, log: provide a --remerge-diff capability
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 8f010412a9c..f6e65fedfa2 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -246,6 +246,7 @@ static int checkout_merged(int pos, const struct checkout *state, struct cache_entry *ce = active_cache[pos]; const char *path = ce->name; mmfile_t ancestor, ours, theirs; + enum ll_merge_result merge_status; int status; struct object_id oid; mmbuffer_t result_buf; @@ -276,13 +277,16 @@ static int checkout_merged(int pos, const struct checkout *state, memset(&ll_opts, 0, sizeof(ll_opts)); git_config_get_bool("merge.renormalize", &renormalize); ll_opts.renormalize = renormalize; - status = ll_merge(&result_buf, path, &ancestor, "base", - &ours, "ours", &theirs, "theirs", - state->istate, &ll_opts); + merge_status = ll_merge(&result_buf, path, &ancestor, "base", + &ours, "ours", &theirs, "theirs", + state->istate, &ll_opts); free(ancestor.ptr); free(ours.ptr); free(theirs.ptr); - if (status < 0 || !result_buf.ptr) { + if (merge_status == LL_MERGE_BINARY_CONFLICT) + warning("Cannot merge binary files: %s (%s vs. %s)", + path, "ours", "theirs"); + if (merge_status < 0 || !result_buf.ptr) { free(result_buf.ptr); return error(_("path '%s': cannot merge"), path); } |