Skip to content

Commit d126289

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 083c4a5 commit d126289

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
@@ -2,6 +2,7 @@
22
#include "../../hashmap.h"
33
#include "../win32.h"
44
#include "fscache.h"
5+
#include "config.h"
56

67
static int initialized;
78
static volatile long enabled;
@@ -396,7 +397,11 @@ int fscache_enable(int enable)
396397
int result;
397398

398399
if (!initialized) {
400+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
401+
399402
/* allow the cache to be disabled entirely */
403+
if (fscache != -1)
404+
core_fscache = fscache;
400405
if (!core_fscache)
401406
return 0;
402407

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ GIT_TEST_CHECKOUT_WORKERS=<n> overrides the 'checkout.workers' setting
448448
to <n> and 'checkout.thresholdForParallelism' to 0, forcing the
449449
execution of the parallel-checkout code.
450450

451+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
452+
which adds a cache below mingw's lstat and dirent implementations.
453+
451454
Naming Tests
452455
------------
453456

0 commit comments

Comments
 (0)