summaryrefslogtreecommitdiff
path: root/t/t6020-merge-df.sh
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-09-20 02:28:43 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:32:37 -0700
commitfa0ae3b1ddeeb8c872f3804950fa95b5fc8b4138 (patch)
tree91993f4254494db14edbeb88dd7f066f90d4dd8a /t/t6020-merge-df.sh
parentd09c0a3935c6f28b1e7710f3f08a6ff5dec50f73 (diff)
downloadgit-fa0ae3b1ddeeb8c872f3804950fa95b5fc8b4138.tar.gz
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>
Diffstat (limited to 't/t6020-merge-df.sh')
-rwxr-xr-xt/t6020-merge-df.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/t/t6020-merge-df.sh b/t/t6020-merge-df.sh
index 8662207d29..bc9db1a0f0 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