git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] mingw_rename: support ReFS on Windows 2022

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 3, 2025, 21:25 UTC
Message-ID
<768a84c8c6ec063717d4a935b86d8110ba0a00c6.1754256318.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1948.git.1754256318.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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 391bceae4350 (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 https://github.com/git-for-windows/git/issues/5427
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 compat/mingw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index c331c3ac32a8..d53ce38b7f82 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2277,7 +2277,7 @@ repeat:
 		 * current system doesn't support FileRenameInfoEx. Keep us
 		 * from using it in future calls and retry.
 		 */
-		if (gle == ERROR_INVALID_PARAMETER) {
+		if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
 			supports_file_rename_info_ex = 0;
 			goto repeat;
 		}
-- 
gitgitgadget
Previous: Oswald BuddenhagenNext: Johannes Schindelin via GitGitGadget
Message 5 of 7 in “mingw: rename and open fixes”
  1. 0/4 mingw: rename and open fixesJohannes Schindelin via GitGitGadget, Aug 3, 2025
  2. 1/4 mingw_open_existing: handle directories betterMatthias Aßhauer via GitGitGadget, Aug 3, 2025
  3. 2/4 mingw: drop Windows 7-specific work-aroundJohannes Schindelin via GitGitGadget, Aug 3, 2025
  4. Oswald BuddenhagenAug 4, 2025
  5. 3/4 mingw_rename: support ReFS on Windows 2022Johannes Schindelin via GitGitGadget, Aug 3, 2025
  6. 4/4 mingw: support Windows Server 2016 againJohannes Schindelin via GitGitGadget, Aug 3, 2025
  7. Junio C HamanoAug 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.