summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/run.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 13:16:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 13:16:23 +0000
commiteebab08ecd6c247fa464f40934f852d63daba9bb (patch)
treeab61e7678c576d3489623464241ec67faf455964 /pre_commit/commands/run.py
parentReleasing debian version 2.19.0-1. (diff)
downloadpre-commit-eebab08ecd6c247fa464f40934f852d63daba9bb.tar.xz
pre-commit-eebab08ecd6c247fa464f40934f852d63daba9bb.zip
Merging upstream version 2.20.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands/run.py')
-rw-r--r--pre_commit/commands/run.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
index 37f989b..ad3d766 100644
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -361,6 +361,16 @@ def run(
):
return 0
+ # Expose prepare_commit_message_source / commit_object_name
+ # as environment variables for the hooks
+ if args.prepare_commit_message_source:
+ environ['PRE_COMMIT_COMMIT_MSG_SOURCE'] = (
+ args.prepare_commit_message_source
+ )
+
+ if args.commit_object_name:
+ environ['PRE_COMMIT_COMMIT_OBJECT_NAME'] = args.commit_object_name
+
# Expose from-ref / to-ref as environment variables for hooks to consume
if args.from_ref and args.to_ref:
# legacy names