Skip to content

Commit

Permalink
improvements/fixes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
aless10 committed Feb 26, 2024
1 parent 34fc791 commit 506480f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
/.tox
/dist
.vscode/
.idea
8 changes: 2 additions & 6 deletions pre_commit/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,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
Expand Down
6 changes: 0 additions & 6 deletions tests/commands/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',),
Expand Down

0 comments on commit 506480f

Please sign in to comment.