diff --git a/builtin/help.c b/builtin/help.c index 6133fe496..2ae8a1e98 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -171,7 +171,7 @@ static void exec_man_cmd(const char *cmd, const char *page) { struct strbuf shell_cmd = STRBUF_INIT; strbuf_addf(&shell_cmd, "%s %s", cmd, page); - execl("/bin/sh", "sh", "-c", shell_cmd.buf, (char *)NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", shell_cmd.buf, (char *)NULL); warning(_("failed to exec '%s': %s"), cmd, strerror(errno)); } diff --git a/git-compat-util.h b/git-compat-util.h index a3095be96..fbfd10dad 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -876,4 +876,8 @@ struct tm *git_gmtime_r(const time_t *, struct tm *); #define USE_PARENS_AROUND_GETTEXT_N 1 #endif +#ifndef SHELL_PATH +# define SHELL_PATH "/bin/sh" +#endif + #endif diff --git a/git-instaweb.sh b/git-instaweb.sh index 513efa662..47e38f34c 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -20,6 +20,7 @@ start start the web server restart restart the web server " +SUBDIRECTORY_OK=Yes . git-sh-setup fqgitdir="$GIT_DIR" @@ -204,7 +205,7 @@ webrick_conf () { # actual gitweb.cgi using a shell script to force it wrapper="$fqgitdir/gitweb/$httpd/wrapper.sh" cat > "$wrapper" <expect && - test_must_fail git ${1:+-c push.default="$1"} push && + test_must_fail git ${1:+-c} ${1:+push.default="$1"} push && git --git-dir=repo1 log --no-walk --format='%h %s' --all >actual && test_cmp expect actual }