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