diff --git a/compat/win32/fscache.c b/compat/win32/fscache.c index 5f9516f532..97e68a36a1 100644 --- a/compat/win32/fscache.c +++ b/compat/win32/fscache.c @@ -8,11 +8,6 @@ static volatile long enabled; static struct hashmap map; static CRITICAL_SECTION mutex; -int fscache_is_enabled(void) -{ - return enabled; -} - /* * An entry in the file system cache. Used for both entire directory listings * and file entries. @@ -247,7 +242,7 @@ static void fscache_clear(void) /* * Checks if the cache is enabled for the given path. */ -static inline int fscache_enabled(const char *path) +int fscache_enabled(const char *path) { return enabled > 0 && !is_absolute_path(path); } diff --git a/compat/win32/fscache.h b/compat/win32/fscache.h index 9a21fd5709..660ada053b 100644 --- a/compat/win32/fscache.h +++ b/compat/win32/fscache.h @@ -4,8 +4,8 @@ int fscache_enable(int enable); #define enable_fscache(x) fscache_enable(x) -int fscache_is_enabled(void); -#define is_fscache_enabled() (fscache_is_enabled()) +int fscache_enabled(const char *path); +#define is_fscache_enabled(path) fscache_enabled(path) DIR *fscache_opendir(const char *dir); int fscache_lstat(const char *file_name, struct stat *buf); diff --git a/dir.c b/dir.c index 8ccb44a638..92093b6b46 100644 --- a/dir.c +++ b/dir.c @@ -786,7 +786,7 @@ static int add_excludes(const char *fname, const char *base, int baselen, size_t size = 0; char *buf; - if (is_fscache_enabled()) { + if (is_fscache_enabled(fname)) { if (lstat(fname, &st) < 0) { fd = -1; } else { diff --git a/git-compat-util.h b/git-compat-util.h index 0c83a78c32..20421e2a6f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1284,7 +1284,7 @@ static inline int is_missing_file_error(int errno_) #endif #ifndef is_fscache_enabled -#define is_fscache_enabled() (0) +#define is_fscache_enabled(path) (0) #endif extern int cmd_main(int, const char **);