read-tree: narrow scope of index expansion for '--prefix'
[alt-git.git] / t / t0055-beyond-symlinks.sh
blob6bada3702257649551558884237f71bea3fdadc2
1 #!/bin/sh
3 test_description='update-index and add refuse to add beyond symlinks'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success SYMLINKS setup '
9 >a &&
10 mkdir b &&
11 ln -s b c &&
12 >c/d &&
13 git update-index --add a b/d
16 test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
17 test_must_fail git update-index --add c/d &&
18 ! ( git ls-files | grep c/d )
21 test_expect_success SYMLINKS 'add beyond symlinks' '
22 test_must_fail git add c/d &&
23 ! ( git ls-files | grep c/d )
26 test_done