1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-25 14:46:09 +02:00
git/t/t0055-beyond-symlinks.sh
Ævar Arnfjörð Bjarmason c150064dbe leak tests: run various built-in tests in t00*.sh SANITIZE=leak
Mark various existing tests in t00*.sh that invoke git built-ins with
TEST_PASSES_SANITIZE_LEAK=true as passing when git is compiled with
SANITIZE=leak.

They'll now be listed as running under the
"GIT_TEST_PASSING_SANITIZE_LEAK=true" test mode (the "linux-leaks" CI
target).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-10-12 18:23:24 -07:00

27 lines
518 B
Bash
Executable File

#!/bin/sh
test_description='update-index and add refuse to add beyond symlinks'
TEST_PASSES_SANITIZE_LEAK=true
. ./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 &&
! ( git ls-files | grep c/d )
'
test_expect_success SYMLINKS 'add beyond symlinks' '
test_must_fail git add c/d &&
! ( git ls-files | grep c/d )
'
test_done