mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Expose local branch ref as an environment variable
This commit is contained in:
parent
8037b45cb1
commit
584fd585ec
5 changed files with 17 additions and 2 deletions
|
|
@ -371,7 +371,11 @@ def run(
|
|||
environ['PRE_COMMIT_FROM_REF'] = args.from_ref
|
||||
environ['PRE_COMMIT_TO_REF'] = args.to_ref
|
||||
|
||||
if args.remote_name and args.remote_url and args.remote_branch:
|
||||
if (
|
||||
args.remote_name and args.remote_url and
|
||||
args.remote_branch and args.local_branch
|
||||
):
|
||||
environ['PRE_COMMIT_LOCAL_BRANCH'] = args.local_branch
|
||||
environ['PRE_COMMIT_REMOTE_BRANCH'] = args.remote_branch
|
||||
environ['PRE_COMMIT_REMOTE_NAME'] = args.remote_name
|
||||
environ['PRE_COMMIT_REMOTE_URL'] = args.remote_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue