Skip to content

Commit 1ef8a17

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

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
@@ -103,4 +103,24 @@ test_expect_success 'in partial clone, sparse checkout only fetches needed blobs
103103
test_cmp expect actual
104104
'
105105

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

0 commit comments

Comments
 (0)