1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 00:37:55 +01:00
git/t/t0055-beyond-symlinks.sh
Junio C Hamano 725b06050a add: refuse to add working tree items beyond symlinks
This is the same fix for the issue of adding "sym/path" when "sym" is a
symblic link that points at a directory "dir" with "path" in it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-04 23:31:23 -07:00

25 lines
460 B
Bash
Executable file

#!/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