1
0
Fork 0

Adding upstream version 2.5.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:20:03 +01:00
parent 080d7f9289
commit bb6dbf8636
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
37 changed files with 457 additions and 213 deletions

View file

@ -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']),
@ -117,7 +118,7 @@ def test_check_args_length_error_too_many_plural():
)
def test_check_args_length_error_too_many_singluar():
def test_check_args_length_error_too_many_singular():
with pytest.raises(SystemExit) as excinfo:
hook_impl._check_args_length('commit-msg', [])
msg, = excinfo.value.args
@ -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