summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-15 22:22:16 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-15 22:22:16 +0200
commit0da7673a519cbebd44258ac4b12e7ad481a37f84 (patch)
tree046109f27592bbcc31df1e2953823011bab537a7 /t
parentMerge branch 'jc/refs-symref-referent' (diff)
parentdiff-tree: fix crash when used with --remerge-diff (diff)
downloadgit-0da7673a519cbebd44258ac4b12e7ad481a37f84.tar.xz
git-0da7673a519cbebd44258ac4b12e7ad481a37f84.zip
Merge branch 'xx/diff-tree-remerge-diff-fix'
"git rev-list ... | git diff-tree -p --remerge-diff --stdin" should behave more or less like "git log -p --remerge-diff" but instead it crashed, forgetting to prepare a temporary object store needed. * xx/diff-tree-remerge-diff-fix: diff-tree: fix crash when used with --remerge-diff
Diffstat (limited to '')
-rwxr-xr-xt/t4069-remerge-diff.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh
index 07323ebafe..ca8f999cab 100755
--- a/t/t4069-remerge-diff.sh
+++ b/t/t4069-remerge-diff.sh
@@ -110,6 +110,41 @@ test_expect_success 'can filter out additional headers with pickaxe' '
test_must_be_empty actual
'
+test_expect_success 'remerge-diff also works for git-diff-tree' '
+ # With a clean merge
+ git diff-tree -r -p --remerge-diff --no-commit-id bc_resolution >actual &&
+ test_must_be_empty actual &&
+
+ # With both a resolved conflict and an unrelated change
+ cat <<-EOF >tmp &&
+ diff --git a/numbers b/numbers
+ remerge CONFLICT (content): Merge conflict in numbers
+ index a1fb731..6875544 100644
+ --- a/numbers
+ +++ b/numbers
+ @@ -1,13 +1,9 @@
+ 1
+ 2
+ -<<<<<<< b0ed5cb (change_a)
+ -three
+ -=======
+ -tres
+ ->>>>>>> 6cd3f82 (change_b)
+ +drei
+ 4
+ 5
+ 6
+ 7
+ -eight
+ +acht
+ 9
+ EOF
+ sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >expect &&
+ git diff-tree -r -p --remerge-diff --no-commit-id ab_resolution >tmp &&
+ sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'setup non-content conflicts' '
git switch --orphan base &&