chiark / gitweb /
git pre-commit hooks are always run from the root
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 9 Nov 2014 13:29:28 +0000 (14:29 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 9 Nov 2014 13:29:28 +0000 (14:29 +0100)
No need to find out the basedir. We don't do it for the python tests anyway.

hooks/pre-commit

index e7198e91db1a9a06bc3150d7b82a5c61c33e3400..1f5229e67f34d551916da0fbedad5b815c45b4d7 100755 (executable)
@@ -37,16 +37,9 @@ fi
 #------------------------------------------------------------------------------#
 # check the syntax of included shell scripts
 
-basedir=`cd $(dirname $0)/.. && pwd`
-echo basedir: $basedir
-
-if [ $(basename $basedir) = ".git" ]; then
-    basedir=$(dirname $basedir)
-fi
-
 exitstatus=0
 # use bash to check that the syntax is correct
-for f in $basedir/fd-commit $basedir/jenkins-build $basedir/docs/*.sh $basedir/hooks/pre-commit; do
+for f in fd-commit jenkins-build docs/*.sh hooks/pre-commit; do
     if bash -n $f; then
         : # success! do nothing
     else