diff options
| author | Adam Roben <adam@roben.org> | 2019-08-24 15:38:56 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-08-26 10:06:03 -0700 |
| commit | 4e1a641ee345bbc877ed82962e12c45f09b6617b (patch) | |
| tree | 51d518ed0d44e3ce0e80558113fcad9cb56ec2ab /commit.c | |
| parent | First batch after Git 2.23 (diff) | |
| download | git-4e1a641ee345bbc877ed82962e12c45f09b6617b.tar.gz git-4e1a641ee345bbc877ed82962e12c45f09b6617b.zip | |
mingw: fix launching of externals from Unicode paths
If Git were installed in a path containing non-ASCII characters,
commands such as `git am` and `git submodule`, which are implemented as
externals, would fail to launch with the following error:
> fatal: 'am' appears to be a git command, but we were not
> able to execute it. Maybe git-am is broken?
This was due to lookup_prog not being Unicode-aware. It was somehow
missed in 85faec9d3a (Win32: Unicode file name support (except dirent),
2012-03-15).
Note that the only problem in this function was calling
`GetFileAttributes()` instead of `GetFileAttributesW()`. The calls to
`access()` were fine because `access()` is a macro which resolves to
`mingw_access()`, which already handles Unicode correctly. But
`lookup_prog()` was changed to use `_waccess()` directly so that we only
convert the path to UTF-16 once.
To make things work correctly, we have to maintain UTF-8 and UTF-16
versions in tandem in `lookup_prog()`.
Signed-off-by: Adam Roben <adam@roben.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions
