Skip to content

Commit 9fb151e

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

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

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

0 commit comments

Comments
 (0)