3 # Copyright (c) 2005 Fredrik Kuivinen
6 test_description
='Test merge with directory/file conflicts'
9 test_expect_success
'prepare repository' '
12 git commit -m initial &&
18 git commit -m "File: dir/foo" &&
23 git commit -m "File: dir"
26 test_expect_success
'Merge with d/f conflicts' '
27 test_expect_code 1 git merge "merge msg" B master
30 test_expect_success
'F/D conflict' '
32 git checkout master &&
36 echo FILE >before/one &&
39 git commit -m first &&
42 git mv before after &&
45 git checkout -b para HEAD^ &&
46 echo COMPLETELY ANOTHER FILE >another &&
53 test_expect_success
'setup modify/delete + directory/file conflict' '
54 git checkout --orphan modify &&
58 printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters &&
60 git commit -m initial &&
64 git commit -m modified &&
66 git checkout -b delete HEAD^ &&
74 test_expect_success
'modify/delete + directory/file conflict' '
75 git checkout delete^0 &&
76 test_must_fail git merge modify &&
78 test 3 = $(git ls-files -s | wc -l) &&
79 test 2 = $(git ls-files -u | wc -l) &&
80 test 1 = $(git ls-files -o | wc -l) &&
82 test -f letters/file &&
83 test -f letters~modify
86 test_expect_success
'modify/delete + directory/file conflict; other way' '
89 git checkout modify^0 &&
90 test_must_fail git merge delete &&
92 test 3 = $(git ls-files -s | wc -l) &&
93 test 2 = $(git ls-files -u | wc -l) &&
94 test 1 = $(git ls-files -o | wc -l) &&
96 test -f letters/file &&