[PATCH 10/37] t6020: Add a testcase for modify/delete + directory/file conflict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Elijah Newren <newren@xxxxxxxxx>
---
 t/t6020-merge-df.sh |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/t/t6020-merge-df.sh b/t/t6020-merge-df.sh
index 8662207..bc9db1a 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
-- 
1.7.3.271.g16009

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]