tvl-depot/t/t0055-beyond-symlinks.sh
Vincent Ambo 1b593e1ea4 Squashed 'third_party/git/' content from commit cb71568594
git-subtree-dir: third_party/git
git-subtree-split: cb715685942260375e1eb8153b0768a376e4ece7
2020-01-11 23:36:56 +00:00

25 lines
487 B
Bash
Executable file

#!/bin/sh
test_description='update-index and add refuse to add beyond symlinks'
. ./test-lib.sh
test_expect_success SYMLINKS setup '
>a &&
mkdir b &&
ln -s b c &&
>c/d &&
git update-index --add a b/d
'
test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
test_must_fail git update-index --add c/d &&
! ( git ls-files | grep c/d )
'
test_expect_success SYMLINKS 'add beyond symlinks' '
test_must_fail git add c/d &&
! ( git ls-files | grep c/d )
'
test_done