From: Elijah Newren Date: Mon, 20 Sep 2010 08:28:43 +0000 (-0600) Subject: t6020: Add a testcase for modify/delete + directory/file conflict X-Git-Tag: v1.7.4-rc0~101^2~29 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fa0ae3b1ddeeb8c872f3804950fa95b5fc8b4138;p=git.git t6020: Add a testcase for modify/delete + directory/file conflict Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- diff --git a/t/t6020-merge-df.sh b/t/t6020-merge-df.sh index 8662207d2..bc9db1a0f 100755 --- a/t/t6020-merge-df.sh +++ b/t/t6020-merge-df.sh @@ -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