t3030: use test_ln_s_add to remove SYMLINKS prerequisite
The test cases include many corner-cases of merge-recursive's behavior, some of them involve type changes and symbolic links. All cases, including those that are protected by SYMLINKS check only whether the result of merge-recursive is correctly stored in the database and the index; the file system is not investigated. Use test_ln_s_add to enter a symbolic link in the index in the test setup and run the tests without the SYMLINKS prerequisite. Notice that one test that has the SYMLINKS protection removed is an expect_failure. There is a possibility that the test fails differently depending on whether SYMLINKS is present or not; but this is not the case presently. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c723a76d4d
commit
bba56042e7
@ -25,10 +25,7 @@ test_expect_success 'setup 1' '
|
|||||||
git branch submod &&
|
git branch submod &&
|
||||||
git branch copy &&
|
git branch copy &&
|
||||||
git branch rename &&
|
git branch rename &&
|
||||||
if test_have_prereq SYMLINKS
|
git branch rename-ln &&
|
||||||
then
|
|
||||||
git branch rename-ln
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
echo hello >>a &&
|
echo hello >>a &&
|
||||||
cp a d/e &&
|
cp a d/e &&
|
||||||
@ -260,16 +257,12 @@ test_expect_success 'setup 8' '
|
|||||||
git add e &&
|
git add e &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git commit -m "rename a->e" &&
|
git commit -m "rename a->e" &&
|
||||||
if test_have_prereq SYMLINKS
|
git checkout rename-ln &&
|
||||||
then
|
git mv a e &&
|
||||||
git checkout rename-ln &&
|
test_ln_s_add e a &&
|
||||||
git mv a e &&
|
test_tick &&
|
||||||
ln -s e a &&
|
git commit -m "rename a->e, symlink a->e" &&
|
||||||
git add a e &&
|
oln=`printf e | git hash-object --stdin`
|
||||||
test_tick &&
|
|
||||||
git commit -m "rename a->e, symlink a->e" &&
|
|
||||||
oln=`printf e | git hash-object --stdin`
|
|
||||||
fi
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'setup 9' '
|
test_expect_success 'setup 9' '
|
||||||
@ -569,28 +562,25 @@ test_expect_success 'merge-recursive copy vs. rename' '
|
|||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
if test_have_prereq SYMLINKS
|
test_expect_failure 'merge-recursive rename vs. rename/symlink' '
|
||||||
then
|
|
||||||
test_expect_failure 'merge-recursive rename vs. rename/symlink' '
|
|
||||||
|
|
||||||
git checkout -f rename &&
|
git checkout -f rename &&
|
||||||
git merge rename-ln &&
|
git merge rename-ln &&
|
||||||
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
|
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
|
||||||
(
|
(
|
||||||
echo "120000 blob $oln a"
|
echo "120000 blob $oln a"
|
||||||
echo "100644 blob $o0 b"
|
echo "100644 blob $o0 b"
|
||||||
echo "100644 blob $o0 c"
|
echo "100644 blob $o0 c"
|
||||||
echo "100644 blob $o0 d/e"
|
echo "100644 blob $o0 d/e"
|
||||||
echo "100644 blob $o0 e"
|
echo "100644 blob $o0 e"
|
||||||
echo "120000 $oln 0 a"
|
echo "120000 $oln 0 a"
|
||||||
echo "100644 $o0 0 b"
|
echo "100644 $o0 0 b"
|
||||||
echo "100644 $o0 0 c"
|
echo "100644 $o0 0 c"
|
||||||
echo "100644 $o0 0 d/e"
|
echo "100644 $o0 0 d/e"
|
||||||
echo "100644 $o0 0 e"
|
echo "100644 $o0 0 e"
|
||||||
) >expected &&
|
) >expected &&
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Reference in New Issue
Block a user