diff: fix filtering of additional headers under --remerge-diff
commit71a146dc701931363d78aa21ad215da648252617
authorElijah Newren <newren@gmail.com>
Fri, 2 Sep 2022 03:53:29 +0000 (2 03:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Sep 2022 16:22:25 +0000 (2 09:22 -0700)
treecd790892e2c441c41c4c7f93426f9f213b2f8e71
parent9b08091cb72bdd1d8b37446bcf0a6d73d319bf10
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>
diff.c
t/t4069-remerge-diff.sh