2008-08-04 09:51:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-08-04 09:52:37 +02:00
|
|
|
test_description='update-index and add refuse to add beyond symlinks'
|
2008-08-04 09:51:42 +02:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success setup '
|
|
|
|
>a &&
|
|
|
|
mkdir b &&
|
|
|
|
ln -s b c &&
|
|
|
|
>c/d &&
|
|
|
|
git update-index --add a b/d
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'update-index --add beyond symlinks' '
|
|
|
|
test_must_fail git update-index --add c/d &&
|
|
|
|
! ( git ls-files | grep c/d )
|
|
|
|
'
|
|
|
|
|
2008-08-04 09:52:37 +02:00
|
|
|
test_expect_success 'add beyond symlinks' '
|
|
|
|
test_must_fail git add c/d &&
|
|
|
|
! ( git ls-files | grep c/d )
|
|
|
|
'
|
|
|
|
|
2008-08-04 09:51:42 +02:00
|
|
|
test_done
|