File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ v0.26 + 1
33
44### Changes or improvements
55
6+ * Improved ` p_unlink ` in ` posix_w32.c ` to try and make a file writable
7+ before sleeping in the retry loop to prevent unnecessary calls to sleep.
8+
69### API additions
710
811### API removals
Original file line number Diff line number Diff line change @@ -162,12 +162,15 @@ GIT_INLINE(bool) last_error_retryable(void)
162162
163163#define do_with_retries (fn , remediation ) \
164164 do { \
165- int __tries, __ret; \
166- for (__tries = 0; __tries < git_win32__retries; __tries++) { \
167- if (__tries && (__ret = (remediation)) != 0) \
168- return __ret; \
165+ int __retry, __ret; \
166+ for (__retry = git_win32__retries; __retry; __retry--) { \
169167 if ((__ret = (fn)) != GIT_RETRY) \
170168 return __ret; \
169+ if (__retry > 1 && (__ret = (remediation)) != 0) { \
170+ if (__ret == GIT_RETRY) \
171+ continue; \
172+ return __ret; \
173+ } \
171174 Sleep(5); \
172175 } \
173176 return -1; \
@@ -186,7 +189,7 @@ static int ensure_writable(wchar_t *path)
186189 if (!SetFileAttributesW (path , (attrs & ~FILE_ATTRIBUTE_READONLY )))
187190 goto on_error ;
188191
189- return 0 ;
192+ return GIT_RETRY ;
190193
191194on_error :
192195 set_errno ();
You can’t perform that action at this time.
0 commit comments