Merge branch 'jk/squelch-missing-link-warning-for-unreachable'
[gitweb.git] / templates / hooks--pre-applypatch.sample
index b1f187c2e9acaba942639bca90a63c5b4f058967..4142082bcb939bbc17985a69ba748491ac6b62a5 100755 (executable)
@@ -9,6 +9,6 @@
 # To enable this hook, rename this file to "pre-applypatch".
 
 . git-sh-setup
-test -x "$GIT_DIR/hooks/pre-commit" &&
-       exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+precommit="$(git rev-parse --git-path hooks/pre-commit)"
+test -x "$precommit" && exec "$precommit" ${1+"$@"}
 :