diff options
author | Elijah Newren <newren@gmail.com> | 2018-06-30 21:11:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 14:43:42 -0700 |
commit | c6d3dd5daf60e7b33d5843bb5dec44fcf852d239 (patch) | |
tree | cb4a31b37245b97c318f5046d6eeb913f1c6ccce | |
parent | Second batch for 2.19 cycle (diff) | |
download | tgif-c6d3dd5daf60e7b33d5843bb5dec44fcf852d239.tar.xz |
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>
-rwxr-xr-x | t/t6036-recursive-corner-cases.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index b5621303d6..4a94fa5ba6 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 |