-
-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-push should forbid unrelated staged changes while pushing #2486
Comments
you'll have to provide more information and a reproduction |
also show the full output, do not redact anything |
Not related to dotnet format
Installation pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push Output:
Create a file with some whitespaces at end
Add and commit the file
Output
Try to
Add the spaces.txt in staged to commit but don't commit anything
Try to
It succeeds to push with spaces at the end |
hmmm interesting -- the "unstaged changes" check I guess really only makes sense for |
This comment was marked as off-topic.
This comment was marked as off-topic.
is this issue solved? |
is the issue closed? |
search tried in the issue tracker
yes
describe your issue
I configured dotnet format as push hook in my .pre-commit-config.yaml
I installed them using
I committed a modification with dotnet format not following correct rules, it passes
I try to push, it is rejected with error
And it corrects my file after dotnet format
When I try to push again, I have the same error.
When I add the file in staged changes without commit it, I can push.
I expect to be rejected even if I put the correct file in staged changes.
pre-commit --version
pre-commit 2.20.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered: