aboutsummaryrefslogtreecommitdiff
path: root/scripts/git
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-08-08 11:32:11 -0400
committerNick Mathewson <nickm@torproject.org>2019-08-08 11:36:05 -0400
commit71e5af0221568b36d128be88c958a7de018ebcb3 (patch)
tree3a735e4394c03da74ed525523b1ec050ac49fe4f /scripts/git
parenta8f936c817d0afc586c6791b9e02b94483c80ae3 (diff)
downloadtor-71e5af0221568b36d128be88c958a7de018ebcb3.tar.gz
tor-71e5af0221568b36d128be88c958a7de018ebcb3.zip
pre-push hook: Only run practracker when a special file is present
Closes ticket 30979.
Diffstat (limited to 'scripts/git')
-rwxr-xr-xscripts/git/pre-push.git-hook13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/git/pre-push.git-hook b/scripts/git/pre-push.git-hook
index 71abc9aa2b..40a3bffa79 100755
--- a/scripts/git/pre-push.git-hook
+++ b/scripts/git/pre-push.git-hook
@@ -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
-