aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2011-08-11 23:19:35 -0600
committerJunio C Hamano <gitster@pobox.com>2011-08-14 14:19:31 -0700
commit58040239f59004f71d9ae70d0fcd9e0d4f6a3259 (patch)
tree0dee948be35f2d2e9fd75d0532c83c29faf658db /t
parent695576fddd039b2fdc3cad52bbaab4d89e27b71c (diff)
downloadgit-58040239f59004f71d9ae70d0fcd9e0d4f6a3259.tar.gz
git-58040239f59004f71d9ae70d0fcd9e0d4f6a3259.tar.xz
t6042: Add failing testcase for rename/modify/add-source conflict
If there is a cleanly resolvable rename/modify conflict AND there is a new file introduced on the renamed side of the merge whose name happens to match that of the source of the rename (but is otherwise unrelated to the rename), then git fails to cleanly resolve the merge despite the fact that the new file should not cause any problems. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6042-merge-rename-corner-cases.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh
index 505445998..276d7dd2d 100755
--- a/t/t6042-merge-rename-corner-cases.sh
+++ b/t/t6042-merge-rename-corner-cases.sh
@@ -33,4 +33,43 @@ test_expect_failure "Does git preserve Gollum's precious artifact?" '
test -f ring
'
+# Testcase setup for rename/modify/add-source:
+# Commit A: new file: a
+# Commit B: modify a slightly
+# Commit C: rename a->b, add completely different a
+#
+# We should be able to merge B & C cleanly
+
+test_expect_success 'setup rename/modify/add-source conflict' '
+ git rm -rf . &&
+ git clean -fdqx &&
+ rm -rf .git &&
+ git init &&
+
+ printf "1\n2\n3\n4\n5\n6\n7\n" >a &&
+ git add a &&
+ git commit -m A &&
+ git tag A &&
+
+ git checkout -b B A &&
+ echo 8 >>a &&
+ git add a &&
+ git commit -m B &&
+
+ git checkout -b C A &&
+ git mv a b &&
+ echo something completely different >a &&
+ git add a &&
+ git commit -m C
+'
+
+test_expect_failure 'rename/modify/add-source conflict resolvable' '
+ git checkout B^0 &&
+
+ git merge -s recursive C^0 &&
+
+ test $(git rev-parse B:a) = $(git rev-parse b) &&
+ test $(git rev-parse C:a) = $(git rev-parse a)
+'
+
test_done