aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pre-commit
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pre-commit')
-rwxr-xr-xtools/pre-commit3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/pre-commit b/tools/pre-commit
index 55b9c9c96d..38f6a9b61d 100755
--- a/tools/pre-commit
+++ b/tools/pre-commit
@@ -8,8 +8,9 @@
# http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
#
+"$GIT_DIR" || GIT_DIR=.git
# Check for newer versions of the pre-commit script
-if [ ./.git/hooks/pre-commit -ot ./tools/pre-commit ] ; then
+if [ ${GIT_DIR}/hooks/pre-commit -ot ./tools/pre-commit ] ; then
echo "Pre-commit hook script is outdated, please update!"
fi