Merge branch 'km/bsd-shells'
Portability fixes and workarounds for shell scripts have been added to help BSD-derived systems. * km/bsd-shells: t5528: do not fail with FreeBSD shell help.c: use SHELL_PATH instead of hard-coded "/bin/sh" git-compat-util.h: move SHELL_PATH default into header git-instaweb: use @SHELL_PATH@ instead of /bin/sh git-instaweb: allow running in a working tree subdirectory
This commit is contained in:
commit
ec0465ade8
@ -171,7 +171,7 @@ static void exec_man_cmd(const char *cmd, const char *page)
|
|||||||
{
|
{
|
||||||
struct strbuf shell_cmd = STRBUF_INIT;
|
struct strbuf shell_cmd = STRBUF_INIT;
|
||||||
strbuf_addf(&shell_cmd, "%s %s", cmd, page);
|
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));
|
warning(_("failed to exec '%s': %s"), cmd, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,4 +876,8 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
|
|||||||
#define USE_PARENS_AROUND_GETTEXT_N 1
|
#define USE_PARENS_AROUND_GETTEXT_N 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SHELL_PATH
|
||||||
|
# define SHELL_PATH "/bin/sh"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -20,6 +20,7 @@ start start the web server
|
|||||||
restart restart the web server
|
restart restart the web server
|
||||||
"
|
"
|
||||||
|
|
||||||
|
SUBDIRECTORY_OK=Yes
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
|
||||||
fqgitdir="$GIT_DIR"
|
fqgitdir="$GIT_DIR"
|
||||||
@ -204,7 +205,7 @@ webrick_conf () {
|
|||||||
# actual gitweb.cgi using a shell script to force it
|
# actual gitweb.cgi using a shell script to force it
|
||||||
wrapper="$fqgitdir/gitweb/$httpd/wrapper.sh"
|
wrapper="$fqgitdir/gitweb/$httpd/wrapper.sh"
|
||||||
cat > "$wrapper" <<EOF
|
cat > "$wrapper" <<EOF
|
||||||
#!/bin/sh
|
#!@SHELL_PATH@
|
||||||
# we use this shell script wrapper around the real gitweb.cgi since
|
# we use this shell script wrapper around the real gitweb.cgi since
|
||||||
# there appears to be no other way to pass arbitrary environment variables
|
# there appears to be no other way to pass arbitrary environment variables
|
||||||
# into the CGI process
|
# into the CGI process
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
#include "sigchain.h"
|
#include "sigchain.h"
|
||||||
#include "argv-array.h"
|
#include "argv-array.h"
|
||||||
|
|
||||||
#ifndef SHELL_PATH
|
|
||||||
# define SHELL_PATH "/bin/sh"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void child_process_init(struct child_process *child)
|
void child_process_init(struct child_process *child)
|
||||||
{
|
{
|
||||||
memset(child, 0, sizeof(*child));
|
memset(child, 0, sizeof(*child));
|
||||||
|
@ -26,7 +26,7 @@ check_pushed_commit () {
|
|||||||
# $2 = expected target branch for the push
|
# $2 = expected target branch for the push
|
||||||
# $3 = [optional] repo to check for actual output (repo1 by default)
|
# $3 = [optional] repo to check for actual output (repo1 by default)
|
||||||
test_push_success () {
|
test_push_success () {
|
||||||
git ${1:+-c push.default="$1"} push &&
|
git ${1:+-c} ${1:+push.default="$1"} push &&
|
||||||
check_pushed_commit HEAD "$2" "$3"
|
check_pushed_commit HEAD "$2" "$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ test_push_success () {
|
|||||||
# check that push fails and does not modify any remote branch
|
# check that push fails and does not modify any remote branch
|
||||||
test_push_failure () {
|
test_push_failure () {
|
||||||
git --git-dir=repo1 log --no-walk --format='%h %s' --all >expect &&
|
git --git-dir=repo1 log --no-walk --format='%h %s' --all >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 &&
|
git --git-dir=repo1 log --no-walk --format='%h %s' --all >actual &&
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user