1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-14 04:36:11 +02:00

Merge branch 'jh/mingw-unlink'

"unlink" emulation on MinGW has been optimized.

* jh/mingw-unlink:
  mingw: improve performance of mingw_unlink()
This commit is contained in:
Junio C Hamano 2020-08-19 16:14:53 -07:00
commit 5a0482662f

View File

@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname)
if (xutftowcs_path(wpathname, pathname) < 0)
return -1;
if (DeleteFileW(wpathname))
return 0;
/* read-only files cannot be removed */
_wchmod(wpathname, 0666);
while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {