summaryrefslogtreecommitdiff
path: root/t/t6036-recursive-corner-cases.sh
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-07-01 04:11:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-03 21:43:42 (GMT)
commitc6d3dd5daf60e7b33d5843bb5dec44fcf852d239 (patch)
treecb4a31b37245b97c318f5046d6eeb913f1c6ccce /t/t6036-recursive-corner-cases.sh
parente3331758f12da22f4103eec7efe1b5304a9be5e9 (diff)
downloadgit-c6d3dd5daf60e7b33d5843bb5dec44fcf852d239.zip
git-c6d3dd5daf60e7b33d5843bb5dec44fcf852d239.tar.gz
git-c6d3dd5daf60e7b33d5843bb5dec44fcf852d239.tar.bz2
t6036: add a failed conflict detection case with symlink modify/modify
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6036-recursive-corner-cases.sh')
-rwxr-xr-xt/t6036-recursive-corner-cases.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh
index b562130..4a94fa5 100755
--- a/t/t6036-recursive-corner-cases.sh
+++ b/t/t6036-recursive-corner-cases.sh
@@ -805,4 +805,71 @@ test_expect_success 'virtual merge base handles rename/rename(1to2)/add-dest' '
)
'
+#
+# criss-cross with modify/modify on a symlink:
+#
+# B D
+# o---o
+# / \ / \
+# A o X ? F
+# \ / \ /
+# o---o
+# C E
+#
+# Commit A: simple simlink fickle->lagoon
+# Commit B: redirect fickle->disneyland
+# Commit C: redirect fickle->home
+# Commit D: merge B&C, resolving in favor of B
+# Commit E: merge B&C, resolving in favor of C
+#
+# This is an obvious modify/modify conflict for the symlink 'fickle'. Can
+# git detect it?
+
+test_expect_success 'setup symlink modify/modify' '
+ test_create_repo symlink-modify-modify &&
+ (
+ cd symlink-modify-modify &&
+
+ test_ln_s_add lagoon fickle &&
+ git commit -m A &&
+ git tag A &&
+
+ git checkout -b B A &&
+ git rm fickle &&
+ test_ln_s_add disneyland fickle &&
+ git commit -m B &&
+
+ git checkout -b C A &&
+ git rm fickle &&
+ test_ln_s_add home fickle &&
+ git add fickle &&
+ git commit -m C &&
+
+ git checkout -q B^0 &&
+ git merge -s ours -m D C^0 &&
+ git tag D &&
+
+ git checkout -q C^0 &&
+ git merge -s ours -m E B^0 &&
+ git tag E
+ )
+'
+
+test_expect_failure 'check symlink modify/modify' '
+ (
+ cd symlink-modify-modify &&
+
+ git checkout D^0 &&
+
+ test_must_fail git merge -s recursive E^0 &&
+
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 3 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out
+ )
+'
+
test_done