Skip to content

Commit 6b8bbe6

Browse files
committed
Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2 parents 44fcf2c + fac12af commit 6b8bbe6

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;
@@ -382,7 +383,11 @@ int fscache_enable(int enable)
382383
int result;
383384

384385
if (!initialized) {
386+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
387+
385388
/* allow the cache to be disabled entirely */
389+
if (fscache != -1)
390+
core_fscache = fscache;
386391
if (!core_fscache)
387392
return 0;
388393

t/README

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

413+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
414+
which adds a cache below mingw's lstat and dirent implementations.
415+
413416
Naming Tests
414417
------------
415418

0 commit comments

Comments
 (0)