mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add: post-merge hook support
This commit is contained in:
parent
d7b189ce56
commit
6b73138c73
9 changed files with 82 additions and 5 deletions
|
|
@ -97,6 +97,7 @@ def test_run_legacy_recursive(tmpdir):
|
|||
('pre-push', ['branch_name', 'remote_name']),
|
||||
('commit-msg', ['.git/COMMIT_EDITMSG']),
|
||||
('post-commit', []),
|
||||
('post-merge', ['1']),
|
||||
('post-checkout', ['old_head', 'new_head', '1']),
|
||||
# multiple choices for commit-editmsg
|
||||
('prepare-commit-msg', ['.git/COMMIT_EDITMSG']),
|
||||
|
|
@ -157,6 +158,14 @@ def test_run_ns_post_commit():
|
|||
assert ns.color is True
|
||||
|
||||
|
||||
def test_run_ns_post_merge():
|
||||
ns = hook_impl._run_ns('post-merge', True, ('1',), b'')
|
||||
assert ns is not None
|
||||
assert ns.hook_stage == 'post-merge'
|
||||
assert ns.color is True
|
||||
assert ns.is_squash_merge == '1'
|
||||
|
||||
|
||||
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