From 8b9f67e46f462980dd0877e752954a07bfecdb32 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Sep 2021 06:23:44 +0200 Subject: Adding upstream version 2.15.0. Signed-off-by: Daniel Baumann --- pre_commit/commands/hook_impl.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pre_commit/commands/hook_impl.py') diff --git a/pre_commit/commands/hook_impl.py b/pre_commit/commands/hook_impl.py index c544167..90bb33b 100644 --- a/pre_commit/commands/hook_impl.py +++ b/pre_commit/commands/hook_impl.py @@ -78,6 +78,7 @@ def _ns( commit_msg_filename: Optional[str] = None, checkout_type: Optional[str] = None, is_squash_merge: Optional[str] = None, + rewrite_command: Optional[str] = None, ) -> argparse.Namespace: return argparse.Namespace( color=color, @@ -92,6 +93,7 @@ def _ns( all_files=all_files, checkout_type=checkout_type, is_squash_merge=is_squash_merge, + rewrite_command=rewrite_command, files=(), hook=None, verbose=False, @@ -166,6 +168,7 @@ _EXPECTED_ARG_LENGTH_BY_HOOK = { 'pre-commit': 0, 'pre-merge-commit': 0, 'post-merge': 1, + 'post-rewrite': 1, 'pre-push': 2, } @@ -209,6 +212,8 @@ def _run_ns( ) elif hook_type == 'post-merge': return _ns(hook_type, color, is_squash_merge=args[0]) + elif hook_type == 'post-rewrite': + return _ns(hook_type, color, rewrite_command=args[0]) else: raise AssertionError(f'unexpected hook type: {hook_type}') -- cgit v1.2.3