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 https://github.com/git-for-windows/git/issues/3686

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2022-02-07 19:20:48 +01:00
parent 5437f0fd36
commit 97d21a94e1

View File

@@ -5,6 +5,7 @@
#include "config.h"
#include "../../mem-pool.h"
#include "ntifs.h"
#include "../../dir.h"
static volatile long initialized;
static DWORD dwTlsIndex;
@@ -101,7 +102,7 @@ static int fsentry_cmp(void *unused_cmp_data,
/* if list parts are equal, compare len and name */
if (fse1->len != fse2->len)
return fse1->len - fse2->len;
return strnicmp(fse1->dirent.d_name, fse2->dirent.d_name, fse1->len);
return fspathncmp(fse1->dirent.d_name, fse2->dirent.d_name, fse1->len);
}
/*