Commit 28f4250
committed
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 <johannes.schindelin@gmx.de>1 parent 5907f97 commit 28f4250
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2000 | 2000 | | |
2001 | 2001 | | |
2002 | 2002 | | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
2003 | 2007 | | |
2004 | 2008 | | |
2005 | 2009 | | |
| |||
2193 | 2197 | | |
2194 | 2198 | | |
2195 | 2199 | | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
2196 | 2206 | | |
2197 | 2207 | | |
2198 | 2208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
301 | 308 | | |
0 commit comments