From: Nick Mathewson Date: Mon, 26 Aug 2019 14:15:25 +0000 (-0400) Subject: Merge remote-tracking branch 'tor-github/pr/1241' X-Git-Tag: tor-0.4.2.1-alpha~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eff95429fd5fd1e7a9431c7ccdbe89310c4b9704;p=thirdparty%2Ftor.git Merge remote-tracking branch 'tor-github/pr/1241' --- eff95429fd5fd1e7a9431c7ccdbe89310c4b9704 diff --cc scripts/git/pre-commit.git-hook index 7c7cf88574,37060fdbe8..b2a1847a2b --- a/scripts/git/pre-commit.git-hook +++ b/scripts/git/pre-commit.git-hook @@@ -36,10 -37,19 +37,19 @@@ elif [ -d src/common ]; the src/tools/*.[ch] fi -if test -e scripts/maint/checkIncludes.py; then - python scripts/maint/checkIncludes.py +if test -e scripts/maint/practracker/includes.py; then + python scripts/maint/practracker/includes.py fi - if [ -e scripts/maint/practracker/practracker.py ]; then - python3 ./scripts/maint/practracker/practracker.py "$workdir" + # Only call practracker if ${PT_DIR}/.enable_practracker_in_hooks exists + # We do this check so that we can enable practracker in hooks in master, and + # disable it on maint branches + 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