@matheusbsbs / matheus-bagliano / commits / fa0ae3b1dd
Fork 0

t6020: Add a testcase for modify/delete + directory/file conflict

Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Sep 20, 2010 at 02:28 UTC fa0ae3b1ddeeb8c872f3804950fa95b5fc8b4138
1 file changed +47
t/t6020-merge-df.sh
+47
@@ -50,4 +50,51 @@ test_expect_success 'F/D conflict' '
50 git merge master
51 '
52
53 +test_expect_success 'setup modify/delete + directory/file conflict' '
54 + git checkout --orphan modify &&
55 + git rm -rf . &&
56 + git clean -fdqx &&
57 +
58 + printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters &&
59 + git add letters &&
60 + git commit -m initial &&
61 +
62 + echo i >>letters &&
63 + git add letters &&
64 + git commit -m modified &&
65 +
66 + git checkout -b delete HEAD^ &&
67 + git rm letters &&
68 + mkdir letters &&
69 + >letters/file &&
70 + git add letters &&
71 + git commit -m deleted
72 +'
73 +
74 +test_expect_failure 'modify/delete + directory/file conflict' '
75 + git checkout delete^0 &&
76 + test_must_fail git merge modify &&
77 +
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) &&
81 +
82 + test -f letters/file &&
83 + test -f letters~modify
84 +'
85 +
86 +test_expect_failure 'modify/delete + directory/file conflict; other way' '
87 + git reset --hard &&
88 + git clean -f &&
89 + git checkout modify^0 &&
90 + test_must_fail git merge delete &&
91 +
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) &&
95 +
96 + test -f letters/file &&
97 + test -f letters~HEAD
98 +'
99 +
100 test_done