Skip to content

Commit b3cc58c

Browse files
committed
Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2 parents acc4259 + 5b8dd17 commit b3cc58c

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
@@ -3,6 +3,7 @@
33
#include "../win32.h"
44
#include "fscache.h"
55
#include "../../dir.h"
6+
#include "config.h"
67

78
static int initialized;
89
static volatile long enabled;
@@ -399,7 +400,11 @@ int fscache_enable(int enable)
399400
int result;
400401

401402
if (!initialized) {
403+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
404+
402405
/* allow the cache to be disabled entirely */
406+
if (fscache != -1)
407+
core_fscache = fscache;
403408
if (!core_fscache)
404409
return 0;
405410

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ a test and then fails then the whole test run will abort. This can help to make
498498
sure the expected tests are executed and not silently skipped when their
499499
dependency breaks or is simply not present in a new environment.
500500

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

0 commit comments

Comments
 (0)