Skip to content

Commit 349641e

Browse files
benpeartdscho
authored andcommitted
fscache: add GIT_TEST_FSCACHE support
Add support to fscache to enable running the entire test suite with the fscache enabled. Signed-off-by: Ben Peart <[email protected]>
1 parent c53ce36 commit 349641e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compat/win32/fscache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "../../dir.h"
66
#include "../../abspath.h"
77
#include "../../trace.h"
8+
#include "config.h"
89

910
static int initialized;
1011
static volatile long enabled;
@@ -406,7 +407,11 @@ int fscache_enable(int enable)
406407
int result;
407408

408409
if (!initialized) {
410+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
411+
409412
/* allow the cache to be disabled entirely */
413+
if (fscache != -1)
414+
core_fscache = fscache;
410415
if (!core_fscache)
411416
return 0;
412417

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ GIT_TEST_NAME_HASH_VERSION=<int>, when set, causes 'git pack-objects' to
479479
assume '--name-hash-version=<n>'.
480480

481481

482+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
483+
which adds a cache below mingw's lstat and dirent implementations.
484+
482485
Naming Tests
483486
------------
484487

0 commit comments

Comments
 (0)