mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 10:01:46 +04:00
Merge f6c6b6c55f into 5c0f3024d2
This commit is contained in:
commit
0a4e331d79
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