add support for post-commit

This commit is contained in:
ModischFabrications 2020-04-25 01:21:12 +02:00 committed by Anthony Sottile
parent 3b3b33ea29
commit 26adf1d560
7 changed files with 42 additions and 6 deletions

View file

@ -221,7 +221,8 @@ def _compute_cols(hooks: Sequence[Hook]) -> int:
def _all_filenames(args: argparse.Namespace) -> Collection[str]:
if args.hook_stage == 'post-checkout': # no files for post-checkout
# these hooks do not operate on files
if args.hook_stage in {'post-checkout', 'post-commit'}:
return ()
elif args.hook_stage in {'prepare-commit-msg', 'commit-msg'}:
return (args.commit_msg_filename,)