Skip to content

Commit f1ed769

Browse files
dschogitster
authored andcommitted
mingw(is_msys2_sh): handle forward slashes in the sh.exe path, too
Whether the full path to the MSYS2 Bash is specified using backslashes or forward slashes, in either case the command-line arguments need to be quoted in the MSYS2-specific manner instead of using regular Win32 command-line quoting rules. In preparation for `prepare_shell_cmd()` to use the full path to `sh.exe` (with forward slashes for consistency), let's teach the `is_msys2_sh()` function about this; Otherwise 5580.4 'clone with backslashed path' would fail once `prepare_shell_cmd()` uses the full path instead of merely `sh`. This patch relies on the just-introduced fix where `fspathcmp()` handles backslashes and forward slashes as equivalent on Windows. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 193eda7 commit f1ed769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static int is_msys2_sh(const char *cmd)
15461546
return ret;
15471547
}
15481548

1549-
if (ends_with(cmd, "\\sh.exe")) {
1549+
if (ends_with(cmd, "\\sh.exe") || ends_with(cmd, "/sh.exe")) {
15501550
static char *sh;
15511551

15521552
if (!sh)

0 commit comments

Comments
 (0)