aboutsummaryrefslogtreecommitdiff
path: root/scripts/git/pre-commit.git-hook
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/git/pre-commit.git-hook')
-rwxr-xr-xscripts/git/pre-commit.git-hook5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/git/pre-commit.git-hook b/scripts/git/pre-commit.git-hook
index f630a242bd..33af3fdf6e 100755
--- a/scripts/git/pre-commit.git-hook
+++ b/scripts/git/pre-commit.git-hook
@@ -7,6 +7,11 @@
# it fails our code formatting, changelog entry formatting, module include
# rules, or best practices tracker.
+# Run only if this environment variable is set.
+if [ -z "$TOR_EXTRA_PRE_COMMIT_CHECKS" ]; then
+ exit 0
+fi
+
workdir=$(git rev-parse --show-toplevel)
cd "$workdir" || exit 1