moved the remote branch env variable to the block below it.

This commit is contained in:
Surafel Worku 2021-01-21 22:26:06 -08:00
parent d62ac20518
commit aab18e46c6
No known key found for this signature in database
GPG key ID: B9796C488D287B5D
2 changed files with 3 additions and 11 deletions

View file

@ -52,8 +52,4 @@ repos:
hooks: hooks:
- id: check-hooks-apply - id: check-hooks-apply
- id: check-useless-excludes - id: check-useless-excludes
- repo: https://github.com/clumio-code/pre-push-hooks
rev: v0.1.0
hooks:
- id: check-branch-for-push
args: ['--pattern', '^user/.*', '--pattern', '^team/.*', '--pattern', '^revert-[0-9]+-user/.*']

View file

@ -371,12 +371,8 @@ def run(
environ['PRE_COMMIT_FROM_REF'] = args.from_ref environ['PRE_COMMIT_FROM_REF'] = args.from_ref
environ['PRE_COMMIT_TO_REF'] = args.to_ref environ['PRE_COMMIT_TO_REF'] = args.to_ref
# Exposes remote branch ref as an environment variable if args.remote_name and args.remote_url and args.remote_branch:
# for pre-push hooks consumption environ['PRE_COMMIT_REMOTE_BRANCH'] = args.remote_branch
if args.remote_branch:
environ['PRE_COMMIT_REMOTE_REF'] = args.remote_branch
if args.remote_name and args.remote_url:
environ['PRE_COMMIT_REMOTE_NAME'] = args.remote_name environ['PRE_COMMIT_REMOTE_NAME'] = args.remote_name
environ['PRE_COMMIT_REMOTE_URL'] = args.remote_url environ['PRE_COMMIT_REMOTE_URL'] = args.remote_url