diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:42:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:42:18 -0700 |
commit | 4a871de89680842ebd43429d5d972375fb765fda (patch) | |
tree | ea1904d11cfe9169d733f57c51cfc49b5f7330a4 /t | |
parent | 22c09307bf0dc9999920763d94c95086e3a55642 (diff) | |
parent | 725b06050a083474e240a2436121e0a80bb9f175 (diff) | |
download | git-4a871de89680842ebd43429d5d972375fb765fda.tar.gz git-4a871de89680842ebd43429d5d972375fb765fda.tar.xz |
Merge branch 'jc/add-stop-at-symlink'
* jc/add-stop-at-symlink:
add: refuse to add working tree items beyond symlinks
update-index: refuse to add working tree items beyond symlinks
Diffstat (limited to 't')
-rwxr-xr-x | t/t0055-beyond-symlinks.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t0055-beyond-symlinks.sh b/t/t0055-beyond-symlinks.sh new file mode 100755 index 000000000..b29c37a5a --- /dev/null +++ b/t/t0055-beyond-symlinks.sh @@ -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 |