Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mingw: respect core.shell when executing scripts
On Windows, we have to emulate that Linux/Unix/macOS feature where a file starting with a `#!` line and being marked as executable is run as a script through the interpreter specified by said `#!` line. Traditionally, we ignore the actual path specified in that line because it will be a Unix-style path anyway, something that `git.exe` is not even supposed to understand. We then go on to look up the actual path of the interpreter by iterating over the components in the environment variable `PATH`. Let's special-case `sh` in that scenario when the config setting `core.shell` exists: in this case, we want to use it instead. This allows us to configure BusyBox' `ash` to be used for all of the shell scripting needs of the BusyBox flavor of MinGit. While at it, assume that any shell configured via `core.shell` is _not_ an MSYS2 shell, i.e. that we should use regular Win32 command-line quoting, not MSYS2/Cygwin one. Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information