aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pre-commit
diff options
context:
space:
mode:
authorAnish Bhatt <anish@chelsio.com>2014-06-09 17:10:44 -0700
committerEvan Huus <eapache@gmail.com>2014-06-10 00:58:20 +0000
commit8878d7778e6fb10bf9e6ce20af16f4e247e51e04 (patch)
tree0696b3c62a58e1e91f2e062be93e702d61de2d4a /tools/pre-commit
parent9516675ca732a775f085fb53e1e9b95c2f2d1b09 (diff)
Current test for GIT_DIR introduced in changeset Ie1560c372e23e58fb0e310f681388b5e1a65ba5b doesn't seem to be working correctly on bash 4.3.18 : .git/hooks/pre-commit: line 11: .git: command not found
This test works correctly in bash/dash/zsh Change-Id: Ic89fc2764d1a70e9e5d112c7928cee6ed783f50f Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2092 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'tools/pre-commit')
-rwxr-xr-xtools/pre-commit2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pre-commit b/tools/pre-commit
index 38f6a9b61d..62469e1530 100755
--- a/tools/pre-commit
+++ b/tools/pre-commit
@@ -8,7 +8,7 @@
# http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
#
-"$GIT_DIR" || GIT_DIR=.git
+if [ -z $GIT_DIR ]; then GIT_DIR=".git"; fi
# Check for newer versions of the pre-commit script
if [ ${GIT_DIR}/hooks/pre-commit -ot ./tools/pre-commit ] ; then
echo "Pre-commit hook script is outdated, please update!"