improvements/fixes after code review

This commit is contained in:
Alessio Izzo 2024-02-26 16:04:02 +01:00 committed by Anthony Sottile
parent e36cdc227c
commit f6c6b6c55f
3 changed files with 2 additions and 13 deletions

View file

@ -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