Skip to content

Commit 81f5a2c

Browse files
newrengitster
authored andcommitted
t6036: add a failed conflict detection case with symlink add/add
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c6d3dd5 commit 81f5a2c

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

t/t6036-recursive-corner-cases.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,4 +872,70 @@ test_expect_failure 'check symlink modify/modify' '
872872
)
873873
'
874874

875+
#
876+
# criss-cross with add/add of a symlink:
877+
#
878+
# B D
879+
# o---o
880+
# / \ / \
881+
# A o X ? F
882+
# \ / \ /
883+
# o---o
884+
# C E
885+
#
886+
# Commit A: No symlink or path exists yet
887+
# Commit B: set up symlink: fickle->disneyland
888+
# Commit C: set up symlink: fickle->home
889+
# Commit D: merge B&C, resolving in favor of B
890+
# Commit E: merge B&C, resolving in favor of C
891+
#
892+
# This is an obvious add/add conflict for the symlink 'fickle'. Can
893+
# git detect it?
894+
895+
test_expect_success 'setup symlink add/add' '
896+
test_create_repo symlink-add-add &&
897+
(
898+
cd symlink-add-add &&
899+
900+
touch ignoreme &&
901+
git add ignoreme &&
902+
git commit -m A &&
903+
git tag A &&
904+
905+
git checkout -b B A &&
906+
test_ln_s_add disneyland fickle &&
907+
git commit -m B &&
908+
909+
git checkout -b C A &&
910+
test_ln_s_add home fickle &&
911+
git add fickle &&
912+
git commit -m C &&
913+
914+
git checkout -q B^0 &&
915+
git merge -s ours -m D C^0 &&
916+
git tag D &&
917+
918+
git checkout -q C^0 &&
919+
git merge -s ours -m E B^0 &&
920+
git tag E
921+
)
922+
'
923+
924+
test_expect_failure 'check symlink add/add' '
925+
(
926+
cd symlink-add-add &&
927+
928+
git checkout D^0 &&
929+
930+
test_must_fail git merge -s recursive E^0 &&
931+
932+
git ls-files -s >out &&
933+
test_line_count = 2 out &&
934+
git ls-files -u >out &&
935+
test_line_count = 2 out &&
936+
git ls-files -o >out &&
937+
test_line_count = 1 out
938+
)
939+
'
940+
875941
test_done

0 commit comments

Comments
 (0)