Skip to content

Commit 97d21a9

Browse files
committed
fixup! mingw: add a cache below mingw's lstat and dirent implementations
Back when the FSCache was invented, there was no way to ask Windows to store filenames case-sensitively. Also, `fspathcmp()` had not been invented yet, so we simply used `strnicmp()` to compare the filenames in the FSCache. In the meantime, much has changed. Let's use `fspathncmp()` instead, and benefit from case-sensitive file names as configured. Note: to make use of this, users _must_ call `fsutil.exe file setCaseSensitiveInfo .` in an empty directory _before_ calling `git init` to allow Git to detect that filenames are stored case-sensitively. This fixes #3686 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5437f0f commit 97d21a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/win32/fscache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "config.h"
66
#include "../../mem-pool.h"
77
#include "ntifs.h"
8+
#include "../../dir.h"
89

910
static volatile long initialized;
1011
static DWORD dwTlsIndex;
@@ -101,7 +102,7 @@ static int fsentry_cmp(void *unused_cmp_data,
101102
/* if list parts are equal, compare len and name */
102103
if (fse1->len != fse2->len)
103104
return fse1->len - fse2->len;
104-
return strnicmp(fse1->dirent.d_name, fse2->dirent.d_name, fse1->len);
105+
return fspathncmp(fse1->dirent.d_name, fse2->dirent.d_name, fse1->len);
105106
}
106107

107108
/*

0 commit comments

Comments
 (0)