From: Daniel Martí Date: Sun, 9 Nov 2014 13:29:28 +0000 (+0100) Subject: git pre-commit hooks are always run from the root X-Git-Tag: 0.3.0~26 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=92a4bacbf65b2f40f8fa86d00b973d53c22773b0;p=fdroidserver.git git pre-commit hooks are always run from the root No need to find out the basedir. We don't do it for the python tests anyway. --- diff --git a/hooks/pre-commit b/hooks/pre-commit index e7198e91..1f5229e6 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -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