mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Merge f6c6b6c55f into 8416413a0e
This commit is contained in:
commit
4884352391
2 changed files with 40 additions and 5 deletions
|
|
@ -371,7 +371,10 @@ def run(
|
|||
environ.get('_PRE_COMMIT_SKIP_POST_CHECKOUT')
|
||||
):
|
||||
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')
|
||||
return 1
|
||||
# Expose prepare_commit_message_source / commit_object_name
|
||||
# as environment variables for the hooks
|
||||
if args.prepare_commit_message_source:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue