Browse Source
* jc/add-stop-at-symlink: add: refuse to add working tree items beyond symlinks update-index: refuse to add working tree items beyond symlinksmaint
Junio C Hamano
16 years ago
4 changed files with 45 additions and 3 deletions
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh |
||||
|
||||
test_description='update-index and add refuse to add beyond symlinks' |
||||
|
||||
. ./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 ) |
||||
' |
||||
|
||||
test_expect_success 'add beyond symlinks' ' |
||||
test_must_fail git add c/d && |
||||
! ( git ls-files | grep c/d ) |
||||
' |
||||
|
||||
test_done |
Loading…
Reference in new issue