Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-20 02:14:53 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-20 02:14:53 +0300
commit5a0482662f076ca7e1f27ef2848feec1763583d1 (patch)
tree7c2941da2e5d18fa17ecbd05a099597fc3040731 /compat
parent6f8a2138b96c8f33ebbe2055a9444ada40a8e1c8 (diff)
parent680e0b4524482c4bb679030188f6ae8db4caff06 (diff)
Merge branch 'jh/mingw-unlink'
"unlink" emulation on MinGW has been optimized. * jh/mingw-unlink: mingw: improve performance of mingw_unlink()
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 4454b3e67b..a00f331230 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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)) {