Skip to content

Commit 2322f4f

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
mingw_rename: support ReFS on Windows 2022
ReFS is an alternative filesystem to NTFS. On Windows 2022, it seems not to support the rename operation using POSIX semantics that Git uses on Windows as of 391bcea (compat/mingw: support POSIX semantics for atomic renames, 2024-10-27). However, Windows 2022 reports `ERROR_NOT_SUPPORTED` in this instance. This is in contrast to `ERROR_INVALID_PARAMETER` (as previous Windows versions would report that do not support POSIX semantics in renames at all). Let's handle both errors the same: by falling back to the best-effort option, namely to rename without POSIX semantics. This fixes #5427 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c757dcf commit 2322f4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compat/mingw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ int mingw_rename(const char *pold, const char *pnew)
29152915
* current system doesn't support FileRenameInfoEx. Keep us
29162916
* from using it in future calls and retry.
29172917
*/
2918-
if (gle == ERROR_INVALID_PARAMETER) {
2918+
if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
29192919
supports_file_rename_info_ex = 0;
29202920
goto repeat;
29212921
}

0 commit comments

Comments
 (0)