Win32: Unicode file name support (except dirent)
commit85faec9d3acd8bb20e26e2d3386f7d3708d02fca
authorKarsten Blees <blees@dcon.de>
Thu, 15 Mar 2012 17:21:28 +0000 (15 18:21 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jul 2014 18:19:08 +0000 (15 11:19 -0700)
treebfe9bfc7c7f63e88347ce9f6d28c9b26872ed68a
parent66f467c3e6aa9c1e28eaf7b71cea5e452fc104e8
Win32: Unicode file name support (except dirent)

Replaces Windows "ANSI" APIs dealing with file- or path names with their
Unicode equivalent, adding UTF-8/UTF-16LE conversion as necessary.

The dirent API (opendir/readdir/closedir) is updated in a separate commit.

Adds trivial wrappers for access, chmod and chdir.

Adds wrapper for mktemp (needed for both mkstemp and mkdtemp).

The simplest way to convert a repository with legacy-encoded (e.g. Cp1252)
file names to UTF-8 ist to checkout with an old msysgit version and
"git add --all & git commit" with the new version.

Includes a fix for bug reported by John Chen:
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to this commit, these failures were silently ignored due to
strbuf_free in is_dir_empty resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c
compat/mingw.h