pre-push hook: Only run practracker when a special file is present

Closes ticket 30979.
This commit is contained in:
Nick Mathewson
2019-08-08 11:32:11 -04:00
parent a8f936c817
commit 71e5af0221
3 changed files with 14 additions and 5 deletions
+8 -5
View File
@@ -28,10 +28,14 @@ if [ -x "$workdir/.git/hooks/pre-commit" ]; then
fi
fi
if [ -e scripts/maint/practracker/practracker.py ]; then
if ! python3 ./scripts/maint/practracker/practracker.py "$workdir"; then
exit 1
fi
PT_DIR=scripts/maint/practracker
if [ -e "${PT_DIR}/practracker.py" ]; then
if [ -e "${PT_DIR}/.enable_practracker_in_hooks" ]; then
if ! python3 "${PT_DIR}/practracker.py" "$workdir"; then
exit 1
fi
fi
fi
remote="$1"
@@ -104,4 +108,3 @@ do
done
exit 0