summaryrefslogtreecommitdiff
path: root/templates/hooks--applypatch-msg.sample
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:13 (GMT)
commitb849b954d22ee069b0edec1a12c78782ae1e629d (patch)
treec5f3d71a51a6c0f356f496228b0c72358c5269a2 /templates/hooks--applypatch-msg.sample
parent3bc518084acfdbc81a656c9cdff1f1bd50e0615f (diff)
downloadgit-b849b954d22ee069b0edec1a12c78782ae1e629d.zip
git-b849b954d22ee069b0edec1a12c78782ae1e629d.tar.gz
git-b849b954d22ee069b0edec1a12c78782ae1e629d.tar.bz2
*.sh: avoid hardcoding $GIT_DIR/hooks/...
If $GIT_COMMON_DIR is set, it should be $GIT_COMMON_DIR/hooks/, not $GIT_DIR/hooks/. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates/hooks--applypatch-msg.sample')
-rwxr-xr-xtemplates/hooks--applypatch-msg.sample4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/hooks--applypatch-msg.sample b/templates/hooks--applypatch-msg.sample
index 8b2a2fe..a5d7b84 100755
--- a/templates/hooks--applypatch-msg.sample
+++ b/templates/hooks--applypatch-msg.sample
@@ -10,6 +10,6 @@
# To enable this hook, rename this file to "applypatch-msg".
. git-sh-setup
-test -x "$GIT_DIR/hooks/commit-msg" &&
- exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
+test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
: