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
1 changed files with 9 additions and 6 deletions

View File

@ -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