Skip to content

Commit 83bd257

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

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
@@ -82,4 +82,24 @@ test_expect_success 'in partial clone, sparse checkout only fetches needed blobs
8282
test_cmp expect actual
8383
'
8484

85+
test_expect_success MINGW 'no unnecessary opendir() with fscache' '
86+
git clone . fscache-test &&
87+
(
88+
cd fscache-test &&
89+
git config core.fscache 1 &&
90+
echo "/excluded/*" >.git/info/sparse-checkout &&
91+
for f in $(test_seq 10)
92+
do
93+
sha1=$(echo $f | git hash-object -w --stdin) &&
94+
git update-index --add \
95+
--cacheinfo 100644,$sha1,excluded/$f || break
96+
done &&
97+
test_tick &&
98+
git commit -m excluded &&
99+
GIT_TRACE_FSCACHE=1 git status >out 2>err &&
100+
grep excluded err >grep.out &&
101+
test_line_count = 1 grep.out
102+
)
103+
'
104+
85105
test_done

0 commit comments

Comments
 (0)