Add: post-merge hook support

This commit is contained in:
Paweł Sacawa 2021-01-21 06:26:20 -05:00 committed by Anthony Sottile
parent d7b189ce56
commit 6b73138c73
9 changed files with 82 additions and 5 deletions

View file

@ -245,7 +245,7 @@ def _compute_cols(hooks: Sequence[Hook]) -> int:
def _all_filenames(args: argparse.Namespace) -> Collection[str]:
# these hooks do not operate on files
if args.hook_stage in {'post-checkout', 'post-commit'}:
if args.hook_stage in {'post-checkout', 'post-commit', 'post-merge'}:
return ()
elif args.hook_stage in {'prepare-commit-msg', 'commit-msg'}:
return (args.commit_msg_filename,)
@ -379,6 +379,9 @@ def run(
if args.checkout_type:
environ['PRE_COMMIT_CHECKOUT_TYPE'] = args.checkout_type
if args.is_squash_merge:
environ['PRE_COMMIT_IS_SQUASH_MERGE'] = args.is_squash_merge
# Set pre_commit flag
environ['PRE_COMMIT'] = '1'