Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions run-command.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,16 @@ static const char **prepare_shell_cmd(struct strvec *out, const char **argv)
BUG("shell command is empty");

if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
#ifndef GIT_WINDOWS_NATIVE
strvec_push_nodup(out, git_shell_path());
#else
/*
* Leave it to the spawn to find `sh`, as `git_shell_path()`
* does, but keep `argv[0]` as "sh": a BusyBox `sh` applet
* found in its place runs only if it's called by that name.
*/
strvec_push(out, "sh");
#endif
strvec_push(out, "-c");

/*
Expand Down