Skip to content

Commit 2522e04

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

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
@@ -96,4 +96,24 @@ test_expect_success 'in partial clone, sparse checkout only fetches needed blobs
9696
test_cmp expect actual
9797
'
9898

99+
test_expect_success MINGW 'no unnecessary opendir() with fscache' '
100+
git clone . fscache-test &&
101+
(
102+
cd fscache-test &&
103+
git config core.fscache 1 &&
104+
echo "/excluded/*" >.git/info/sparse-checkout &&
105+
for f in $(test_seq 10)
106+
do
107+
sha1=$(echo $f | git hash-object -w --stdin) &&
108+
git update-index --add \
109+
--cacheinfo 100644,$sha1,excluded/$f || break
110+
done &&
111+
test_tick &&
112+
git commit -m excluded &&
113+
GIT_TRACE_FSCACHE=1 git status >out 2>err &&
114+
grep excluded err >grep.out &&
115+
test_line_count = 1 grep.out
116+
)
117+
'
118+
99119
test_done

0 commit comments

Comments
 (0)