| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| def test_pre_push_fails_if_staged_files( | ||
| cap_out, store, repo_with_passing_hook, | ||
| ): |
There was a problem hiding this comment.
this test is probably sufficient -- then you don't need the additional one above
Sorry, something went wrong.
| if ( | ||
| args.hook_stage == 'pre-push' and git.get_staged_files() | ||
| ): |
There was a problem hiding this comment.
the extra parens here do nothing
Sorry, something went wrong.
| logger.error( | ||
| 'Staged files found. Please commit before pushing', | ||
| ) |
There was a problem hiding this comment.
this easily fits on one line
Sorry, something went wrong.
| /.tox | ||
| /dist | ||
| .vscode/ | ||
| .idea |
There was a problem hiding this comment.
please don't touch gitignore files in projects you don't own -- please rebase this out thanks!
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry about that. Removed
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR aims to solve the issue #2486. The idea is to follow the same solution used for #1418 and add the check on the hook name and if there are staged files not committed yet.
About the error message
I did not want to print the list of the staged files, because it can too long and not very useful. I used logger.error to print the message, following what is done in the other checks above.
Alternatives:
fixes #2486