Fix local pre-commit hooks not running

This commit is contained in:
Talia 2022-05-27 10:27:19 +02:00
parent ecc3bbad3f
commit 357a404895

View file

@ -58,17 +58,20 @@ case $indentation in
;; ;;
esac esac
if [ -n "$error" ]
then exit 1
fi
cd $GIT_DIR cd $GIT_DIR
rm -rf $temp rm -rf $temp
if [ -z "$error" ]
then exit 0
else exit 1
fi
hook=$(basename $0) hook=$(basename $0)
if [ -f $GIT_DIR/hooks/$hook ] if [ -f "$GIT_DIR/hooks/$hook" ]
then then
echo Running project-level hook: $GIT_DIR/hooks/$hook echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook $GIT_DIR/hooks/$hook
error=$?
if [ -n "$error" ]
then exit $error
fi
fi fi