[PATCH 01/37] t3030: Add a testcase for resolvable rename/add conflict with symlinks

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

 



From: Schalk, Ken <ken.schalk@xxxxxxxxx>

d5af510 (RE: [PATCH] Avoid rename/add conflict when contents are identical
2010-09-01) avoided erroring out in a rename/add conflict when the contents
were identical.  A simpler fix could have handled that particular testcase,
but it would not correctly handle the case where a symlink is involved.
Add another testcase using symlinks, to avoid breaking that case.

Signed-off-by: Ken Schalk <ken.schalk@xxxxxxxxx>
Signed-off-by: Elijah Newren <newren@xxxxxxxxx>
---
 t/t3030-merge-recursive.sh |   37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index e66e550..3935c4b 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -25,6 +25,10 @@ test_expect_success 'setup 1' '
 	git branch submod &&
 	git branch copy &&
 	git branch rename &&
+	if test_have_prereq SYMLINKS
+	then
+		git branch rename-ln
+	fi &&
 
 	echo hello >>a &&
 	cp a d/e &&
@@ -255,7 +259,16 @@ test_expect_success 'setup 8' '
 	git mv a e &&
 	git add e &&
 	test_tick &&
-	git commit -m "rename a->e"
+	git commit -m "rename a->e" &&
+	if test_have_prereq SYMLINKS
+	then
+		git checkout rename-ln &&
+		git mv a e &&
+		ln -s e a &&
+		git add a e &&
+		test_tick &&
+		git commit -m "rename a->e, symlink a->e"
+	fi
 '
 
 test_expect_success 'setup 9' '
@@ -615,4 +628,26 @@ test_expect_success 'merge-recursive copy vs. rename' '
 	test_cmp expected actual
 '
 
+if test_have_prereq SYMLINKS
+then
+	test_expect_success 'merge-recursive rename vs. rename/symlink' '
+
+		git checkout -f rename &&
+		git merge rename-ln &&
+		( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
+		(
+			echo "100644 blob $o0	b"
+			echo "100644 blob $o0	c"
+			echo "100644 blob $o0	d/e"
+			echo "100644 blob $o0	e"
+			echo "100644 $o0 0	b"
+			echo "100644 $o0 0	c"
+			echo "100644 $o0 0	d/e"
+			echo "100644 $o0 0	e"
+		) >expected &&
+		test_cmp expected actual
+	'
+fi
+
+
 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]