From aab18e46c64ca647f5f424b2eefd0834737760d9 Mon Sep 17 00:00:00 2001 From: Surafel Worku Date: Thu, 21 Jan 2021 22:26:06 -0800 Subject: [PATCH] moved the remote branch env variable to the block below it. --- .pre-commit-config.yaml | 6 +----- pre_commit/commands/run.py | 8 ++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aadae813..a97396c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,8 +52,4 @@ repos: hooks: - id: check-hooks-apply - 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/.*'] + diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index 8523b29f..891488d5 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -371,12 +371,8 @@ def run( environ['PRE_COMMIT_FROM_REF'] = args.from_ref environ['PRE_COMMIT_TO_REF'] = args.to_ref - # Exposes remote branch ref as an environment variable - # for pre-push hooks consumption - if args.remote_branch: - environ['PRE_COMMIT_REMOTE_REF'] = args.remote_branch - - if args.remote_name and args.remote_url: + if args.remote_name and args.remote_url and args.remote_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