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>
This commit is contained in:
Elijah Newren 2010-09-20 02:28:43 -06:00 committed by Junio C Hamano
parent d09c0a3935
commit fa0ae3b1dd

View File

@ -50,4 +50,51 @@ test_expect_success 'F/D conflict' '
git merge master
'
test_expect_success 'setup modify/delete + directory/file conflict' '
git checkout --orphan modify &&
git rm -rf . &&
git clean -fdqx &&
printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters &&
git add letters &&
git commit -m initial &&
echo i >>letters &&
git add letters &&
git commit -m modified &&
git checkout -b delete HEAD^ &&
git rm letters &&
mkdir letters &&
>letters/file &&
git add letters &&
git commit -m deleted
'
test_expect_failure 'modify/delete + directory/file conflict' '
git checkout delete^0 &&
test_must_fail git merge modify &&
test 3 = $(git ls-files -s | wc -l) &&
test 2 = $(git ls-files -u | wc -l) &&
test 1 = $(git ls-files -o | wc -l) &&
test -f letters/file &&
test -f letters~modify
'
test_expect_failure 'modify/delete + directory/file conflict; other way' '
git reset --hard &&
git clean -f &&
git checkout modify^0 &&
test_must_fail git merge delete &&
test 3 = $(git ls-files -s | wc -l) &&
test 2 = $(git ls-files -u | wc -l) &&
test 1 = $(git ls-files -o | wc -l) &&
test -f letters/file &&
test -f letters~HEAD
'
test_done