At some point between Windows 10 Build 17134.1304 and Build 18363.657, the default behavior of `DeleteFileW()` was changed to use POSIX semantics (https://stackoverflow.com/a/60512798). Under those semantics, a file can be deleted even when another process holds an active `MapViewOfFile` view on it: the directory entry is removed immediately, but the underlying data persists until the last handle is closed. On older Windows versions (and Windows 10 builds before that change), `DeleteFileW()` uses legacy semantics where deletion fails outright if any process holds a file mapping. To allow testing code paths that depend on the legacy behavior, introduce a `GIT_TEST_LEGACY_DELETE` environment variable. When set, `mingw_unlink()` uses `SetFileInformationByHandle()` with `FileDispositionInfo` (the non-POSIX variant) instead of `DeleteFileW()`, forcing legacy delete semantics regardless of the Windows version. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
|---|---|---|
| .. | ||
| darwin | ||
| fsmonitor | ||
| linux | ||
| nedmalloc | ||
| poll | ||
| regex | ||
| simple-ipc | ||
| stub | ||
| vcbuild | ||
| win32 | ||
| .gitattributes | ||
| access.c | ||
| apple-common-crypto.h | ||
| basename.c | ||
| bswap.h | ||
| compiler.h | ||
| disk.h | ||
| fileno.c | ||
| fopen.c | ||
| hstrerror.c | ||
| inet_ntop.c | ||
| inet_pton.c | ||
| memmem.c | ||
| mingw-posix.h | ||
| mingw.c | ||
| mingw.h | ||
| mkdir.c | ||
| mmap.c | ||
| msvc-posix.h | ||
| msvc.c | ||
| msvc.h | ||
| nonblock.c | ||
| nonblock.h | ||
| obstack.c | ||
| obstack.h | ||
| open.c | ||
| posix.h | ||
| pread.c | ||
| precompose_utf8.c | ||
| precompose_utf8.h | ||
| qsort_s.c | ||
| regcomp_enhanced.c | ||
| setenv.c | ||
| sha1-chunked.c | ||
| sha1-chunked.h | ||
| snprintf.c | ||
| stat.c | ||
| strcasestr.c | ||
| strdup.c | ||
| strlcpy.c | ||
| strtoimax.c | ||
| strtoumax.c | ||
| terminal.c | ||
| terminal.h | ||
| unsetenv.c | ||
| win32.h | ||
| win32mmap.c | ||
| winansi.c | ||
| zlib-compat.h | ||