aboutsummaryrefslogtreecommitdiff
path: root/t/t3030-merge-recursive.sh
diff options
context:
space:
mode:
authorSchalk, Ken <ken.schalk@intel.com>2010-09-20 02:28:34 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:32:35 -0700
commit8a1c0d322e9b6963f3be6949475983d517d79796 (patch)
treeea2458b73a7bc6097742f6ae53c6b7b924b317c6 /t/t3030-merge-recursive.sh
parenta1155adc2dde23fd664ad47399379cd0561762af (diff)
downloadgit-8a1c0d322e9b6963f3be6949475983d517d79796.tar.gz
git-8a1c0d322e9b6963f3be6949475983d517d79796.tar.xz
t3030: Add a testcase for resolvable rename/add conflict with symlinks
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@intel.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3030-merge-recursive.sh')
-rwxr-xr-xt/t3030-merge-recursive.sh37
1 files changed, 36 insertions, 1 deletions
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index e66e550b2..3935c4b1c 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