Skip to content

Commit 51113ab

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 git-for-windows#5695. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 768a84c commit 51113ab

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
@@ -2277,7 +2277,9 @@ int mingw_rename(const char *pold, const char *pnew)
22772277
* current system doesn't support FileRenameInfoEx. Keep us
22782278
* from using it in future calls and retry.
22792279
*/
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) {
22812283
supports_file_rename_info_ex = 0;
22822284
goto repeat;
22832285
}

0 commit comments

Comments
 (0)