Skip to content

Commit c050b58

Browse files
committed
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 #5695. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 311e67d commit c050b58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compat/mingw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,9 @@ int mingw_rename(const char *pold, const char *pnew)
29162916
* current system doesn't support FileRenameInfoEx. Keep us
29172917
* from using it in future calls and retry.
29182918
*/
2919-
if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
2919+
if (gle == ERROR_INVALID_PARAMETER ||
2920+
gle == ERROR_NOT_SUPPORTED ||
2921+
gle == ERROR_INVALID_FUNCTION) {
29202922
supports_file_rename_info_ex = 0;
29212923
goto repeat;
29222924
}

0 commit comments

Comments
 (0)