Skip to content

Commit bc2dd27

Browse files
committed
fscache: add a test for the dir-not-found optimization
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e81baea commit bc2dd27

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t1090-sparse-checkout-scope.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,24 @@ test_expect_success 'return to full checkout of master' '
4949
test "$(cat b)" = "modified"
5050
'
5151

52+
test_expect_success MINGW 'no unnecessary opendir() with fscache' '
53+
git clone . fscache-test &&
54+
(
55+
cd fscache-test &&
56+
git config core.fscache 1 &&
57+
echo "/excluded/*" >.git/info/sparse-checkout &&
58+
for f in $(test_seq 10)
59+
do
60+
sha1=$(echo $f | git hash-object -w --stdin) &&
61+
git update-index --add \
62+
--cacheinfo 100644,$sha1,excluded/$f || break
63+
done &&
64+
test_tick &&
65+
git commit -m excluded &&
66+
GIT_TRACE_FSCACHE=1 git status >out 2>err &&
67+
grep excluded err >grep.out &&
68+
test_line_count = 1 grep.out
69+
)
70+
'
71+
5272
test_done

0 commit comments

Comments
 (0)