Skip to content

Commit ef7d362

Browse files
newrengitster
authored andcommitted
t7605: add a testcase demonstrating a bug with trivial merges
Repeating a trivial merge more than once will leave the index out of sync, despite being clean before the merge and operating on the exact same heads as the first run. The recorded merge has the correct tree and the working tree is brought up to date, it is just the index that is left as it was before the merge. Every attempt to repeat the merge beyond the first will leave the index in the same weird out-of-sync state. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7b0d47b commit ef7d362

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/t7605-merge-resolve.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test_expect_success 'setup' '
2727
git tag c3
2828
'
2929

30-
test_expect_success 'merge c1 to c2' '
30+
merge_c1_to_c2_cmds='
3131
git reset --hard c1 &&
3232
git merge -s resolve c2 &&
3333
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
@@ -41,6 +41,10 @@ test_expect_success 'merge c1 to c2' '
4141
test 3 = $(git ls-files | wc -l)
4242
'
4343

44+
test_expect_success 'merge c1 to c2' "$merge_c1_to_c2_cmds"
45+
46+
test_expect_failure 'merge c1 to c2, again' "$merge_c1_to_c2_cmds"
47+
4448
test_expect_success 'merge c2 to c3 (fails)' '
4549
git reset --hard c2 &&
4650
test_must_fail git merge -s resolve c3

0 commit comments

Comments
 (0)