Code

t7505: use SHELL_PATH in hook
authorJeff King <peff@peff.net>
Wed, 12 Mar 2008 21:42:43 +0000 (17:42 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Mar 2008 07:57:53 +0000 (00:57 -0700)
The hook doesn't run properly under Solaris /bin/sh. Let's
use the SHELL_PATH the user told us about already instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7505-prepare-commit-msg-hook.sh

index 7ddec99a64273b056ff0f3e1fe1694315045f583..802aa624d0ff6a1add2e1c7e40a651336b450053 100755 (executable)
@@ -25,8 +25,9 @@ export FAKE_EDITOR
 HOOKDIR="$(git rev-parse --git-dir)/hooks"
 HOOK="$HOOKDIR/prepare-commit-msg"
 mkdir -p "$HOOKDIR"
-cat > "$HOOK" <<'EOF'
-#!/bin/sh
+echo "#!$SHELL_PATH" > "$HOOK"
+cat >> "$HOOK" <<'EOF'
+
 if test "$2" = commit; then
   source=$(git-rev-parse "$3")
 else