]>
Commit | Line | Data |
---|---|---|
806d13b1 JH |
1 | #!/bin/sh |
2 | ||
725b0605 | 3 | test_description='update-index and add refuse to add beyond symlinks' |
806d13b1 | 4 | |
c150064d | 5 | TEST_PASSES_SANITIZE_LEAK=true |
806d13b1 JH |
6 | . ./test-lib.sh |
7 | ||
704a3143 | 8 | test_expect_success SYMLINKS setup ' |
806d13b1 JH |
9 | >a && |
10 | mkdir b && | |
11 | ln -s b c && | |
12 | >c/d && | |
13 | git update-index --add a b/d | |
14 | ' | |
15 | ||
704a3143 | 16 | test_expect_success SYMLINKS 'update-index --add beyond symlinks' ' |
806d13b1 JH |
17 | test_must_fail git update-index --add c/d && |
18 | ! ( git ls-files | grep c/d ) | |
19 | ' | |
20 | ||
704a3143 | 21 | test_expect_success SYMLINKS 'add beyond symlinks' ' |
725b0605 JH |
22 | test_must_fail git add c/d && |
23 | ! ( git ls-files | grep c/d ) | |
24 | ' | |
25 | ||
806d13b1 | 26 | test_done |