diff --git a/githooks/pre-commit b/githooks/pre-commit index 53b3fec..58b2598 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -58,17 +58,20 @@ case $indentation in ;; esac +if [ -n "$error" ] +then exit 1 +fi + cd $GIT_DIR rm -rf $temp -if [ -z "$error" ] -then exit 0 -else exit 1 -fi - hook=$(basename $0) -if [ -f $GIT_DIR/hooks/$hook ] +if [ -f "$GIT_DIR/hooks/$hook" ] then echo Running project-level hook: $GIT_DIR/hooks/$hook $GIT_DIR/hooks/$hook + error=$? + if [ -n "$error" ] + then exit $error + fi fi