3 test_description
='Test cherry-pick with directory/file conflicts'
6 test_expect_success
'Initialize repository' '
13 test_expect_success SYMLINKS
'Setup rename across paths each below D/F conflicts' '
19 git checkout -b branch &&
31 test_expect_success SYMLINKS
'Cherry-pick succeeds with rename across D/F conflicts' '
33 git checkout master^0 &&
34 git cherry-pick branch
37 test_expect_success
'Setup rename with file on one side matching directory name on other' '
38 git checkout --orphan nick-testcase &&
43 git commit -m "Empty file" &&
45 git checkout -b simple &&
50 git commit -m "Empty file under empty dir" &&
52 echo content >newfile &&
54 git commit -m "New file"
57 test_expect_success
'Cherry-pick succeeds with was_a_dir/file -> was_a_dir (resolve)' '
59 git checkout -q nick-testcase^0 &&
60 git cherry-pick --strategy=resolve simple
63 test_expect_success
'Cherry-pick succeeds with was_a_dir/file -> was_a_dir (recursive)' '
65 git checkout -q nick-testcase^0 &&
66 git cherry-pick --strategy=recursive simple
69 test_expect_success
'Setup rename with file on one side matching different dirname on other' '
71 git checkout --orphan mergeme &&
76 echo content > sub/file &&
77 echo foo > othersub/whatever &&
79 git commit -m "Common commmit" &&
81 git rm -rf othersub &&
82 git mv sub/file othersub &&
83 git commit -m "Commit to merge" &&
85 git checkout -b newhead mergeme~1 &&
86 >independent-change &&
87 git add independent-change &&
88 git commit -m "Completely unrelated change"
91 test_expect_success
'Cherry-pick with rename to different D/F conflict succeeds (resolve)' '
93 git checkout -q newhead^0 &&
94 git cherry-pick --strategy=resolve mergeme
97 test_expect_success
'Cherry-pick with rename to different D/F conflict succeeds (recursive)' '
99 git checkout -q newhead^0 &&
100 git cherry-pick --strategy=recursive mergeme