Junio C Hamano | 806d13b | 2008-08-04 00:51:42 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Junio C Hamano | 725b060 | 2008-08-04 00:52:37 -0700 | [diff] [blame] | 3 | test_description='update-index and add refuse to add beyond symlinks' |
Junio C Hamano | 806d13b | 2008-08-04 00:51:42 -0700 | [diff] [blame] | 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
Johannes Sixt | 704a314 | 2009-03-04 22:38:24 +0100 | [diff] [blame] | 7 | test_expect_success SYMLINKS setup ' |
Junio C Hamano | 806d13b | 2008-08-04 00:51:42 -0700 | [diff] [blame] | 8 | >a && |
| 9 | mkdir b && |
| 10 | ln -s b c && |
| 11 | >c/d && |
| 12 | git update-index --add a b/d |
| 13 | ' |
| 14 | |
Johannes Sixt | 704a314 | 2009-03-04 22:38:24 +0100 | [diff] [blame] | 15 | test_expect_success SYMLINKS 'update-index --add beyond symlinks' ' |
Junio C Hamano | 806d13b | 2008-08-04 00:51:42 -0700 | [diff] [blame] | 16 | test_must_fail git update-index --add c/d && |
| 17 | ! ( git ls-files | grep c/d ) |
| 18 | ' |
| 19 | |
Johannes Sixt | 704a314 | 2009-03-04 22:38:24 +0100 | [diff] [blame] | 20 | test_expect_success SYMLINKS 'add beyond symlinks' ' |
Junio C Hamano | 725b060 | 2008-08-04 00:52:37 -0700 | [diff] [blame] | 21 | test_must_fail git add c/d && |
| 22 | ! ( git ls-files | grep c/d ) |
| 23 | ' |
| 24 | |
Junio C Hamano | 806d13b | 2008-08-04 00:51:42 -0700 | [diff] [blame] | 25 | test_done |