Expose remote branch ref as an environment variable#1743
Closed
surafelabebe wants to merge 5 commits intopre-commit:masterfrom
Closed
Expose remote branch ref as an environment variable#1743surafelabebe wants to merge 5 commits intopre-commit:masterfrom
surafelabebe wants to merge 5 commits intopre-commit:masterfrom
Conversation
added 4 commits
December 21, 2020 15:21
…r a pre-push hook, which makes decisions on git pushes to a particular remote branch name pattern.
asottile
reviewed
Jan 14, 2021
Member
There was a problem hiding this comment.
hmmm I wonder if it's easy to extend the existing tests to cover this change
pre_commit/commands/run.py
Outdated
| # 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 |
Member
There was a problem hiding this comment.
this should be combined with the block below -- the naming here is inconsistent as well
Author
There was a problem hiding this comment.
I updated the code as recommended. This time one of the tests is failing for some reason.
fff9875 to
d62ac20
Compare
Member
|
seems I can't merge this because you made the pull request from a company account (this also seems to be why pre-commit.ci couldn't autofix your pull request): $ git push clumio-oss HEAD -f
ERROR: Permission to clumio-oss/pre-commit.git denied to asottile.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.I'm going to close this and then reopen another pull request and maintain your authorship there |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The remote branch reference was exposed as an environment variable to be consumed by a pre-push hook, which makes git push decisions to remote branches with a certain name pattern.