Skip to content

Commit c01f644

Browse files
committed
Merge pull request git-for-windows#1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2 parents f5fd79c + 1ca73e3 commit c01f644

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;
@@ -397,7 +398,11 @@ int fscache_enable(int enable)
397398
int result;
398399

399400
if (!initialized) {
401+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
402+
400403
/* allow the cache to be disabled entirely */
404+
if (fscache != -1)
405+
core_fscache = fscache;
401406
if (!core_fscache)
402407
return 0;
403408

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ GIT_TEST_OE_DELTA_SIZE=<n> exercises the uncomon pack-objects code
328328
path where deltas larger than this limit require extra memory
329329
allocation for bookkeeping.
330330

331+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
332+
which adds a cache below mingw's lstat and dirent implementations.
333+
331334
Naming Tests
332335
------------
333336

0 commit comments

Comments
 (0)