summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2022-09-02 03:53:29 +0000
committerJunio C Hamano <gitster@pobox.com>2022-09-02 09:22:25 -0700
commit71a146dc701931363d78aa21ad215da648252617 (patch)
treecd790892e2c441c41c4c7f93426f9f213b2f8e71 /diff.c
parent9b08091cb72bdd1d8b37446bcf0a6d73d319bf10 (diff)
downloadgit-71a146dc701931363d78aa21ad215da648252617.tar.gz
diff: fix filtering of additional headers under --remerge-diff
Commit 95433eeed9 ("diff: add ability to insert additional headers for paths", 2022-02-02) introduced the possibility of additional headers. Because there could be conflicts with no content differences (e.g. a modify/delete conflict resolved in favor of taking the modified file as-is), that commit also modified the diff_queue_is_empty() and diff_flush_patch() logic to ensure these headers were included even if there was no associated content diff. However, when the pickaxe is active, we really only want the remerge conflict headers to be shown when there is an associated content diff. Adjust the logic in these two functions accordingly. This also removes the TEST_PASSES_SANITIZE_LEAK=true declaration from t4069, as there is apparently some kind of memory leak with the pickaxe code. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 7f8637f300..2439310ae1 100644
--- a/diff.c
+++ b/diff.c
@@ -5869,6 +5869,7 @@ static void diff_flush_patch(struct diff_filepair *p, struct diff_options *o)
{
int include_conflict_headers =
(additional_headers(o, p->one->path) &&
+ !o->pickaxe_opts &&
(!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o)));
/*
@@ -5924,6 +5925,7 @@ int diff_queue_is_empty(struct diff_options *o)
int i;
int include_conflict_headers =
(o->additional_path_headers &&
+ !o->pickaxe_opts &&
(!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o)));
if (include_conflict_headers)