Skip to content

Commit 7210e0f

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 90256c3 commit 7210e0f

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;
@@ -353,7 +354,11 @@ int fscache_enable(int enable)
353354
int result;
354355

355356
if (!initialized) {
357+
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
358+
356359
/* allow the cache to be disabled entirely */
360+
if (fscache != -1)
361+
core_fscache = fscache;
357362
if (!core_fscache)
358363
return 0;
359364

t/README

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

409+
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
410+
which adds a cache below mingw's lstat and dirent implementations.
411+
409412
Naming Tests
410413
------------
411414

0 commit comments

Comments
 (0)