diff options
authorElijah Newren <>2016-04-10 06:13:39 (GMT)
committerJunio C Hamano <>2016-04-13 01:33:59 (GMT)
commitef7d3621d76fe210827698cba79c737906048191 (patch)
parent7b0d47b3b6b5b64e02a5aa06b0452cadcdb18355 (diff)
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 <> Signed-off-by: Junio C Hamano <>
1 files changed, 5 insertions, 1 deletions
diff --git a/t/ b/t/
index 0cb9d11..2f80037 100755
--- a/t/
+++ b/t/
@@ -27,7 +27,7 @@ test_expect_success 'setup' '
git tag c3
-test_expect_success 'merge c1 to c2' '
git reset --hard c1 &&
git merge -s resolve c2 &&
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
@@ -41,6 +41,10 @@ test_expect_success 'merge c1 to c2' '
test 3 = $(git ls-files | wc -l)
+test_expect_success 'merge c1 to c2' "$merge_c1_to_c2_cmds"
+test_expect_failure 'merge c1 to c2, again' "$merge_c1_to_c2_cmds"
test_expect_success 'merge c2 to c3 (fails)' '
git reset --hard c2 &&
test_must_fail git merge -s resolve c3