Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git fails on mounted APFS file system #4482

Closed
1 task done
dsl101 opened this issue Jun 29, 2023 · 4 comments
Closed
1 task done

Git fails on mounted APFS file system #4482

dsl101 opened this issue Jun 29, 2023 · 4 comments
Milestone

Comments

@dsl101
Copy link

dsl101 commented Jun 29, 2023

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.41.0.windows.1
cpu: x86_64
built from commit: ff94e79c4724635915dbb3d4ba38f6bb91528260
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.3086]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Repository is in a mounted APFS file system, mapped as M:/

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Windows Terminal running PowerShell 7.2.11

Edit a single file, then add—e.g.:

git add .\app.json
  • What did you expect to occur after running these commands?

The file would be staged

  • What actually happened instead?

Error: Rename from '.git/objects/31/tmp_obj_B1ugIR' to '.git/objects/31/f3444f8cb349e367661b6c6c659cd0934884fd' failed. Should I try again? (y/n)

I believe this is because git is creating its intermediate files 'read only', and that has the effect of setting the uchg flag on APFS, which then means the file can't be renamed or deleted. If I manually remove that flag, and then hit 'y' to the prompt, git will continue.

I haven't found any way to remove that uchg feature on the APFS side, or in the way the drive is mapped on the windows side.

@dscho
Copy link
Member

dscho commented Jun 29, 2023

Oh wow, that's an obscure use case ;-) Quite honestly, I have no viable idea how to address that from Git's side: Its assumption that it can create read-only files and then rename them once finished is pretty firm.

@dsl101
Copy link
Author

dsl101 commented Jun 29, 2023

Yes, I'm basically using the mac in order to run iOS simulator, but my main dev machine & tooling is all on windows and I couldn't face trying to setup & configure it all on the mac :).

I'm assuming there's implicit or explicit ordering there—create file, write contents, set to read only, rename. It would require reversing the last 2 I guess. But I don't know if that's done in one place or everywhere...

@dsl101
Copy link
Author

dsl101 commented Jun 29, 2023

Looks like somewhere around here is the shared code for this kind of thing. Perhaps something like this? (edited to only change attrs if necessary)

diff --git a/compat/mingw.c b/compat/mingw.c
index 274346e5c5..1d9f88fa38 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2687,7 +2687,7 @@ int mingw_accept(int sockfd1, struct sockaddr *sa, socklen_t *sz)
 #undef rename
 int mingw_rename(const char *pold, const char *pnew)
 {
-	DWORD attrs = INVALID_FILE_ATTRIBUTES, gle;
+	DWORD attrs = INVALID_FILE_ATTRIBUTES, gle, attrsold;
 	int tries = 0;
 	wchar_t wpold[MAX_LONG_PATH], wpnew[MAX_LONG_PATH];
 	if (xutftowcs_long_path(wpold, pold) < 0 ||
@@ -2705,6 +2705,16 @@ int mingw_rename(const char *pold, const char *pnew)
 		if (CopyFileW(wpold, wpnew, FALSE) && !mingw_unlink(pold))
 			return 0;
 		gle = GetLastError();
+	} else if ((attrsold = GetFileAttributesW(wpold)) & FILE_ATTRIBUTE_READONLY) {
+		/* if file is read-only, change and retry */
+    SetFileAttributesW(wpold, attrsold & ~FILE_ATTRIBUTE_READONLY);
+		if (MoveFileExW(wpold, wpnew,
+				MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) {
+			/* reset attrs on renamed file */
+	    SetFileAttributesW(wpnew, attrsold);
+			return 0;
+		}
+		gle = GetLastError();
 	}
 
 	/* revert file attributes on failure */
@@ -2719,7 +2729,7 @@ int mingw_rename(const char *pold, const char *pnew)
 	if (attrs == INVALID_FILE_ATTRIBUTES &&
 	    (attrs = GetFileAttributesW(wpnew)) != INVALID_FILE_ATTRIBUTES) {
 		if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
-			DWORD attrsold = GetFileAttributesW(wpold);
+			attrsold = GetFileAttributesW(wpold);
 			if (attrsold == INVALID_FILE_ATTRIBUTES ||
 			    !(attrsold & FILE_ATTRIBUTE_DIRECTORY))
 				errno = EISDIR;

Unfortunately I don't think I have the wherewithal to build & test that, but would be happy to try it if someone can take a look.

@dsl101
Copy link
Author

dsl101 commented Jun 29, 2023

OK, well that was easier than I thought it would be. Downloaded the SDK and built, and my version now works as expected on APFS :). I'll submit a PR in case it's useful for others.

@dsl101 dsl101 closed this as completed Jun 29, 2023
dscho pushed a commit to dsl101/git that referenced this issue Jun 30, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dsl101/git that referenced this issue Jul 6, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho reopened this Jul 7, 2023
@dscho dscho linked a pull request Jul 7, 2023 that will close this issue
@dscho dscho closed this as completed in 04a3d4e Aug 7, 2023
github-actions bot pushed a commit to git-for-windows/build-extra that referenced this issue Aug 7, 2023
When running on a remote APFS share, Git [would
fail](git-for-windows/git#4482), which [has
been fixed](git-for-windows/git#4527).

Signed-off-by: gitforwindowshelper[bot] <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho added this to the Next release milestone Aug 7, 2023
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 7, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 8, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Aug 8, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Aug 8, 2023
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Dec 19, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Dec 30, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Dec 31, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Dec 31, 2024
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 1, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 1, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 1, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 1, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 1, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 2, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 2, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 2, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 3, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 6, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 6, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes git-for-windows#4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 7, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 8, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 8, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 8, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 8, 2025
At least on _some_ APFS network shares, Git fails to rename the object
files because they are marked as read-only, because that has the effect
of setting the uchg flag on APFS, which then means the file can't be
renamed or deleted.

To work around that, when a rename failed, and the read-only flag is
set, try to turn it off and on again.

This fixes #4482

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants