t6036: add a failed conflict detection case with symlink add/add
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c6d3dd5daf
commit
81f5a2ce7b
@ -872,4 +872,70 @@ test_expect_failure 'check symlink modify/modify' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
#
|
||||||
|
# criss-cross with add/add of a symlink:
|
||||||
|
#
|
||||||
|
# B D
|
||||||
|
# o---o
|
||||||
|
# / \ / \
|
||||||
|
# A o X ? F
|
||||||
|
# \ / \ /
|
||||||
|
# o---o
|
||||||
|
# C E
|
||||||
|
#
|
||||||
|
# Commit A: No symlink or path exists yet
|
||||||
|
# Commit B: set up symlink: fickle->disneyland
|
||||||
|
# Commit C: set up symlink: 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 add/add conflict for the symlink 'fickle'. Can
|
||||||
|
# git detect it?
|
||||||
|
|
||||||
|
test_expect_success 'setup symlink add/add' '
|
||||||
|
test_create_repo symlink-add-add &&
|
||||||
|
(
|
||||||
|
cd symlink-add-add &&
|
||||||
|
|
||||||
|
touch ignoreme &&
|
||||||
|
git add ignoreme &&
|
||||||
|
git commit -m A &&
|
||||||
|
git tag A &&
|
||||||
|
|
||||||
|
git checkout -b B A &&
|
||||||
|
test_ln_s_add disneyland fickle &&
|
||||||
|
git commit -m B &&
|
||||||
|
|
||||||
|
git checkout -b C A &&
|
||||||
|
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 add/add' '
|
||||||
|
(
|
||||||
|
cd symlink-add-add &&
|
||||||
|
|
||||||
|
git checkout D^0 &&
|
||||||
|
|
||||||
|
test_must_fail git merge -s recursive E^0 &&
|
||||||
|
|
||||||
|
git ls-files -s >out &&
|
||||||
|
test_line_count = 2 out &&
|
||||||
|
git ls-files -u >out &&
|
||||||
|
test_line_count = 2 out &&
|
||||||
|
git ls-files -o >out &&
|
||||||
|
test_line_count = 1 out
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user