diff options
author | Elijah Newren <newren@gmail.com> | 2022-09-02 06:53:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-02 19:22:25 +0300 |
commit | 67360b75c605e6c1458304378bda8255f72d96b9 (patch) | |
tree | 4a876498e05c15166f7359373bbea9da93e3d88f /t/t4069-remerge-diff.sh | |
parent | 71a146dc701931363d78aa21ad215da648252617 (diff) |
diff: fix filtering of merge commits 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, the added logic was a bit inconsistent between these two
functions. diff_queue_is_empty() overlooked the fact that the
additional headers strmap could be non-NULL and empty, which would cause
it to display commits that should have been filtered out.
Fix the diff_queue_is_empty() logic to also account for
additional_path_headers being empty.
Reported-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4069-remerge-diff.sh')
-rwxr-xr-x | t/t4069-remerge-diff.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh index 95a16d19ae..07323ebafe 100755 --- a/t/t4069-remerge-diff.sh +++ b/t/t4069-remerge-diff.sh @@ -56,6 +56,11 @@ test_expect_success 'remerge-diff on a clean merge' ' test_cmp expect actual ' +test_expect_success 'remerge-diff on a clean merge with a filter' ' + git show --oneline --remerge-diff --diff-filter=U bc_resolution >actual && + test_must_be_empty actual +' + test_expect_success 'remerge-diff with both a resolved conflict and an unrelated change' ' git log -1 --oneline ab_resolution >tmp && cat <<-EOF >>tmp && |