Skip to content

Commit fa27842

Browse files
committed
fixup! mingw (git_terminal_prompt): work around BusyBox & WSL issues
We do not actually need this, as `bash` is not a BusyBox applet, and in the unlikely event anybody would call `git.exe` from within WSL, they would use `/cmd/git.exe` which puts the MSYS2 `bash.exe` into the `PATH` before the WSL `bash`. This reverts commit 040d9db. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent cad52c8 commit fa27842

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

compat/terminal.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ static char *shell_prompt(const char *prompt, int echo)
101101
const char *read_input[] = {
102102
/* Note: call 'bash' explicitly, as 'read -s' is bash-specific */
103103
"bash", "-c", echo ?
104-
"test \"a$SHELL\" != \"a${SHELL%.exe}\" || exit 127; cat >/dev/tty &&"
105-
" read -r line </dev/tty && echo \"$line\"" :
106-
"test \"a$SHELL\" != \"a${SHELL%.exe}\" || exit 127; cat >/dev/tty &&"
107-
" read -r -s line </dev/tty && echo \"$line\" && echo >/dev/tty",
104+
"cat >/dev/tty && read -r line </dev/tty && echo \"$line\"" :
105+
"cat >/dev/tty && read -r -s line </dev/tty && echo \"$line\" && echo >/dev/tty",
108106
NULL
109107
};
110108
struct child_process child = CHILD_PROCESS_INIT;
@@ -140,10 +138,7 @@ static char *shell_prompt(const char *prompt, int echo)
140138
close(child.out);
141139
code = finish_command(&child);
142140
if (code) {
143-
if (code != 127)
144-
error("failed to execute prompt script (exit code %d)",
145-
code);
146-
141+
error("failed to execute prompt script (exit code %d)", code);
147142
return NULL;
148143
}
149144

0 commit comments

Comments
 (0)