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