3 test_description
='merging when a directory was replaced with a symlink'
6 if ! test_have_prereq SYMLINKS
8 say
'Symbolic links not supported, skipping tests.'
12 test_expect_success
'create a commit where dir a/b changed to symlink' '
13 mkdir -p a/b/c a/b-2/c &&
23 git commit -m "dir to symlink"
26 test_expect_success
'keep a/b-2/c/d across checkout' '
27 git checkout HEAD^0 &&
28 git reset --hard master &&
29 git rm --cached a/b &&
30 git commit -m "untracked symlink remains" &&
31 git checkout start^0 &&
35 test_expect_success
'checkout should not have deleted a/b-2/c/d' '
36 git checkout HEAD^0 &&
37 git reset --hard master &&
38 git checkout start^0 &&
42 test_expect_success
'setup for merge test' '
51 test_expect_success
'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '
53 git checkout baseline^0 &&
54 git merge -s resolve master &&
59 test_expect_success
'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '
61 git checkout baseline^0 &&
62 git merge -s recursive master &&
67 test_expect_success
'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '
69 git checkout master^0 &&
70 git merge -s resolve baseline^0 &&
75 test_expect_success
'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '
77 git checkout master^0 &&
78 git merge -s recursive baseline^0 &&
83 test_expect_failure
'do not lose untracked in merge (resolve)' '
85 git checkout baseline^0 &&
87 test_must_fail git merge -s resolve master &&
92 test_expect_success
'do not lose untracked in merge (recursive)' '
94 git checkout baseline^0 &&
96 test_must_fail git merge -s recursive master &&
101 test_expect_success
'do not lose modifications in merge (resolve)' '
103 git checkout baseline^0 &&
104 echo more content >>a/b/c/d &&
105 test_must_fail git merge -s resolve master
108 test_expect_success
'do not lose modifications in merge (recursive)' '
110 git checkout baseline^0 &&
111 echo more content >>a/b/c/d &&
112 test_must_fail git merge -s recursive master
115 test_expect_success
'setup a merge where dir a/b-2 changed to symlink' '
117 git checkout start^0 &&
121 git commit -m "dir a/b-2 to symlink" &&
125 test_expect_success
'merge should not have D/F conflicts (resolve)' '
127 git checkout baseline^0 &&
128 git merge -s resolve test2 &&
133 test_expect_success
'merge should not have D/F conflicts (recursive)' '
135 git checkout baseline^0 &&
136 git merge -s recursive test2 &&
141 test_expect_success
'merge should not have F/D conflicts (recursive)' '
143 git checkout -b foo test2 &&
144 git merge -s recursive baseline^0 &&