mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
improvements/fixes after code review
This commit is contained in:
parent
e36cdc227c
commit
f6c6b6c55f
3 changed files with 2 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,4 +4,3 @@
|
|||
/.tox
|
||||
/dist
|
||||
.vscode/
|
||||
.idea
|
||||
|
|
|
|||
|
|
@ -372,12 +372,8 @@ def run(
|
|||
):
|
||||
return 0
|
||||
# prevent pushing staged files not committed (#2486)
|
||||
if (
|
||||
args.hook_stage == 'pre-push' and git.get_staged_files()
|
||||
):
|
||||
logger.error(
|
||||
'Staged files found. Please commit before pushing',
|
||||
)
|
||||
if args.hook_stage == 'pre-push' and git.get_staged_files():
|
||||
logger.error('Staged files found. Please commit before pushing')
|
||||
return 1
|
||||
# Expose prepare_commit_message_source / commit_object_name
|
||||
# as environment variables for the hooks
|
||||
|
|
|
|||
|
|
@ -364,12 +364,6 @@ def test_show_diff_on_failure(
|
|||
1,
|
||||
False,
|
||||
),
|
||||
(
|
||||
{'hook': 'nope', 'hook_stage': 'pre-push'},
|
||||
(b'[ERROR] Staged files found. Please commit before pushing\n',),
|
||||
1,
|
||||
True,
|
||||
),
|
||||
(
|
||||
{'all_files': True, 'verbose': True},
|
||||
(b'foo.py',),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue