Skip to content

Commit 8861f44

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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t1090-sparse-checkout-scope.sh

+20
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,24 @@ test_expect_success 'in partial clone, sparse checkout only fetches needed blobs
106106
test_cmp expect actual
107107
'
108108

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

0 commit comments

Comments
 (0)