mirror of
https://github.com/git/git.git
synced 2026-01-19 15:09:01 +00:00
mingw: avoid infinite loop in rename()
We have this loop where we try to remove the read-only attribute when rename() fails and try again. If it fails again, let's not try to remove the read-only attribute and try *again*. This fixes https://github.com/git-for-windows/git/issues/1299 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -2391,7 +2391,8 @@ repeat:
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((attrs = GetFileAttributesW(wpnew)) != INVALID_FILE_ATTRIBUTES) {
|
||||
if (attrs == INVALID_FILE_ATTRIBUTES &&
|
||||
(attrs = GetFileAttributesW(wpnew)) != INVALID_FILE_ATTRIBUTES) {
|
||||
if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
DWORD attrsold = GetFileAttributesW(wpold);
|
||||
if (attrsold == INVALID_FILE_ATTRIBUTES ||
|
||||
|
||||
Reference in New Issue
Block a user