mingw: support Windows Server 2016 again

It was reported to the Git for Windows project that a simple `git init` fails on Windows Server 2016: D:\Dev\test> git init error: could not write config file D:/Dev/test/.git/config: Function not implemented fatal: could not set 'core.repositoryformatversion' to '0' According to https://endoflife.date/windows-server, Windows Server 2016 is officially supported for another one-and-a-half years as of time of writing, so this is not good. The culprit is the `mingw_rename()` changes that try to use POSIX semantics when available, but fail to fall back properly on Windows Server 2016. This fixes https://github.com/git-for-windows/git/issues/5695. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Aug 3, 2025 at 21:25 UTC f559d422734ff00dcf42779813edde9fa6069526
1 file changed +3 -1
compat/mingw.c
+3 -1
@@ -2277,7 +2277,9 @@ repeat:
2277 * current system doesn't support FileRenameInfoEx. Keep us
2278 * from using it in future calls and retry.
2279 */
2280 - if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
2280 + if (gle == ERROR_INVALID_PARAMETER ||
2281 + gle == ERROR_NOT_SUPPORTED ||
2282 + gle == ERROR_INVALID_FUNCTION) {
2283 supports_file_rename_info_ex = 0;
2284 goto repeat;
2285 }