git/t/t0055-beyond-symlinks.sh
Patrick Steinhardt fc1ddf42af t: remove TEST_PASSES_SANITIZE_LEAK annotations
Now that the default value for TEST_PASSES_SANITIZE_LEAK is `true` there
is no longer a need to have that variable declared in all of our tests.
Drop it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-11-21 08:23:48 +09:00

36 lines
597 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 &&
cat >expect <<-\EOF &&
a
b/d
EOF
git ls-files >actual &&
test_cmp expect actual
'
test_expect_success SYMLINKS 'add beyond symlinks' '
test_must_fail git add c/d &&
cat >expect <<-\EOF &&
a
b/d
EOF
git ls-files >actual &&
test_cmp expect actual
'
test_done