mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
issue-3292 expose commit_msg_filename as environment variable for the hooks
This commit is contained in:
parent
504149d2ca
commit
2bd8a595d1
1 changed files with 4 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ def run(
|
||||||
):
|
):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# Expose prepare_commit_message_source / commit_object_name
|
# Expose prepare_commit_message_source / commit_object_name / commit_msg_filename
|
||||||
# as environment variables for the hooks
|
# as environment variables for the hooks
|
||||||
if args.prepare_commit_message_source:
|
if args.prepare_commit_message_source:
|
||||||
environ['PRE_COMMIT_COMMIT_MSG_SOURCE'] = (
|
environ['PRE_COMMIT_COMMIT_MSG_SOURCE'] = (
|
||||||
|
|
@ -381,6 +381,9 @@ def run(
|
||||||
if args.commit_object_name:
|
if args.commit_object_name:
|
||||||
environ['PRE_COMMIT_COMMIT_OBJECT_NAME'] = args.commit_object_name
|
environ['PRE_COMMIT_COMMIT_OBJECT_NAME'] = args.commit_object_name
|
||||||
|
|
||||||
|
if args.commit_msg_filename:
|
||||||
|
environ['PRE_COMMIT_COMMIT_MSG_FILENAME'] = args.commit_msg_filename
|
||||||
|
|
||||||
# Expose from-ref / to-ref as environment variables for hooks to consume
|
# Expose from-ref / to-ref as environment variables for hooks to consume
|
||||||
if args.from_ref and args.to_ref:
|
if args.from_ref and args.to_ref:
|
||||||
# legacy names
|
# legacy names
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue