Files
git/t/t1003-read-tree-prefix.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

38 lines
703 B
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='git read-tree --prefix test.
'
. ./test-lib.sh
test_expect_success setup '
echo hello >one &&
git update-index --add one &&
tree=$(git write-tree) &&
echo tree is $tree
'
echo 'one
two/one' >expect
test_expect_success 'read-tree --prefix' '
git read-tree --prefix=two/ $tree &&
git ls-files >actual &&
cmp expect actual
'
test_expect_success 'read-tree --prefix with leading slash exits with error' '
git rm -rf . &&
test_must_fail git read-tree --prefix=/two/ $tree &&
git read-tree --prefix=two/ $tree &&
git rm -rf . &&
test_must_fail git read-tree --prefix=/ $tree &&
git read-tree --prefix= $tree
'
test_done