mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
add support for post-commit
This commit is contained in:
parent
3b3b33ea29
commit
26adf1d560
7 changed files with 42 additions and 6 deletions
|
|
@ -96,6 +96,7 @@ def test_run_legacy_recursive(tmpdir):
|
|||
('pre-merge-commit', []),
|
||||
('pre-push', ['branch_name', 'remote_name']),
|
||||
('commit-msg', ['.git/COMMIT_EDITMSG']),
|
||||
('post-commit', []),
|
||||
('post-checkout', ['old_head', 'new_head', '1']),
|
||||
# multiple choices for commit-editmsg
|
||||
('prepare-commit-msg', ['.git/COMMIT_EDITMSG']),
|
||||
|
|
@ -149,6 +150,13 @@ def test_run_ns_commit_msg():
|
|||
assert ns.commit_msg_filename == '.git/COMMIT_MSG'
|
||||
|
||||
|
||||
def test_run_ns_post_commit():
|
||||
ns = hook_impl._run_ns('post-commit', True, (), b'')
|
||||
assert ns is not None
|
||||
assert ns.hook_stage == 'post-commit'
|
||||
assert ns.color is True
|
||||
|
||||
|
||||
def test_run_ns_post_checkout():
|
||||
ns = hook_impl._run_ns('post-checkout', True, ('a', 'b', 'c'), b'')
|
||||
assert ns is not None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue