git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 3/4] mingw_rename: support ReFS on Windows 2022
Date: Sun, 03 Aug 2025 21:25:17 +0000	[thread overview]
Message-ID: <768a84c8c6ec063717d4a935b86d8110ba0a00c6.1754256318.git.gitgitgadget@gmail.com> (raw)
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


  parent reply	other threads:[~2025-08-03 21:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-03 21:25 [PATCH 0/4] mingw: rename and open fixes Johannes Schindelin via GitGitGadget
2025-08-03 21:25 ` [PATCH 1/4] mingw_open_existing: handle directories better Matthias Aßhauer via GitGitGadget
2025-08-03 21:25 ` [PATCH 2/4] mingw: drop Windows 7-specific work-around Johannes Schindelin via GitGitGadget
2025-08-04  8:54   ` Oswald Buddenhagen
2025-08-03 21:25 ` Johannes Schindelin via GitGitGadget [this message]
2025-08-03 21:25 ` [PATCH 4/4] mingw: support Windows Server 2016 again Johannes Schindelin via GitGitGadget
2025-08-04  1:29 ` [PATCH 0/4] mingw: rename and open fixes Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=768a84c8c6ec063717d4a935b86d8110ba0a00c6.1754256318.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).