Skip to content

Commit 9a4cba5

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 2fe2622 commit 9a4cba5

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;
@@ -393,7 +394,11 @@ int fscache_enable(int enable)
393394
int result;
394395

395396
if (!initialized) {
397+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
398+
396399
/* allow the cache to be disabled entirely */
400+
if (fscache != -1)
401+
core_fscache = fscache;
397402
if (!core_fscache)
398403
return 0;
399404

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=<boolean>, when true (which is
421421
the default when running tests), errors out when an abbreviated option
422422
is used.
423423

424+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
425+
which adds a cache below mingw's lstat and dirent implementations.
426+
424427
Naming Tests
425428
------------
426429

0 commit comments

Comments
 (0)