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>
This commit is contained in:
Schalk, Ken 2010-09-20 02:28:34 -06:00 committed by Junio C Hamano
parent a1155adc2d
commit 8a1c0d322e

View File

@ -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