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 <benpeart@microsoft.com>
This commit is contained in:
Ben Peart 2018-10-04 18:10:21 -04:00 committed by Johannes Schindelin
parent 8126576d75
commit 16a7fb5980
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "../../dir.h"
#include "../../abspath.h"
#include "../../trace.h"
#include "config.h"
static int initialized;
static volatile long enabled;
@ -406,7 +407,11 @@ int fscache_enable(int enable)
int result;
if (!initialized) {
int fscache = git_env_bool("GIT_TEST_FSCACHE", -1);
/* allow the cache to be disabled entirely */
if (fscache != -1)
core_fscache = fscache;
if (!core_fscache)
return 0;

View File

@ -479,6 +479,9 @@ GIT_TEST_NAME_HASH_VERSION=<int>, when set, causes 'git pack-objects' to
assume '--name-hash-version=<n>'.
GIT_TEST_FSCACHE=<boolean> exercises the uncommon fscache code path
which adds a cache below mingw's lstat and dirent implementations.
Naming Tests
------------