You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MSYS2 runtime does its best to emulate the command-line expansion
and de-quoting which would otherwise be performed by the calling shell.
However, in Git we pass arguments to subprocesses that we do *not* want
to be handled that way, e.g. when passing Windows paths.
Note: this is only a problem when calling MSYS2 executables, not when
calling MINGW executables such as git.exe. But sometimes we do call
MSYS2 executables, most notably when setting the use_shell flag in the
child_process structure.
There is no elegant way to determine whether the .exe file to be
executed is an MSYS2 program or a MINGW one. But since the use case of
passing a command line through the shell is so prevalent, we need to
work around this issue at least when executing sh.exe.
Let's introduce an ugly, hard-coded test whether argv[0] is "sh" to
determine whether we need to quote the arguments differently than usual.
That still does not fix the issue completely, but at least it is
something.
Incidentally, this also fixes the problem where `git clone \\server\repo`
failed due to incorrect handling of the backslashes when handing the path
to the git-upload-pack process.
Signed-off-by: Johannes Schindelin <[email protected]>
0 commit comments