mirror of
https://github.com/git/git.git
synced 2024-06-08 05:26: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:
commit
5a0482662f
|
@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname)
|
||||||
if (xutftowcs_path(wpathname, pathname) < 0)
|
if (xutftowcs_path(wpathname, pathname) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (DeleteFileW(wpathname))
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* read-only files cannot be removed */
|
/* read-only files cannot be removed */
|
||||||
_wchmod(wpathname, 0666);
|
_wchmod(wpathname, 0666);
|
||||||
while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
|
while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
|
||||||
|
|
Loading…
Reference in New Issue