Skip to content

Commit 49d2664

Browse files
committed
mingw_rename: support ReFS on Windows 2022 (#5515)
Git on Windows 2022 fails to write config files on ReFS with the error message "Function not implemented". The reason is that `ERROR_NOT_SUPPORTED` is reported (not `ERROR_INVALID_PARAMETER`, as expected). Let's handle both errors the same: by falling back to the best-effort option, namely to rename without POSIX semantics. This fixes #5427
2 parents e810ee5 + 22f42a0 commit 49d2664

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,7 @@ int mingw_rename(const char *pold, const char *pnew)
26062606
* current system doesn't support FileRenameInfoEx. Keep us
26072607
* from using it in future calls and retry.
26082608
*/
2609-
if (gle == ERROR_INVALID_PARAMETER) {
2609+
if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
26102610
supports_file_rename_info_ex = 0;
26112611
goto repeat;
26122612
}

0 commit comments

Comments
 (0)