Skip to content

Commit e931185

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 2a5d448 commit e931185

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;
@@ -401,7 +402,11 @@ int fscache_enable(int enable)
401402
int result;
402403

403404
if (!initialized) {
405+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
406+
404407
/* allow the cache to be disabled entirely */
408+
if (fscache != -1)
409+
core_fscache = fscache;
405410
if (!core_fscache)
406411
return 0;
407412

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ GIT_TEST_FULL_NAME_HASH=<boolean>, when true, sets the default name-hash
499499
function in 'git pack-objects' to be the one used by the --full-name-hash
500500
option.
501501

502+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
503+
which adds a cache below mingw's lstat and dirent implementations.
504+
502505
Naming Tests
503506
------------
504507

0 commit comments

Comments
 (0)