diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-19 07:00:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-19 07:00:25 +0000 |
commit | a5907b904f568d3249b7629ea9ff3b932f723ce3 (patch) | |
tree | b82c427c125ea5fcf9d1e2fb48e4a529fc932fba /tests/commands | |
parent | Adding upstream version 2.18.1. (diff) | |
download | pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.tar.xz pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.zip |
Adding upstream version 2.19.0.upstream/2.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/commands')
-rw-r--r-- | tests/commands/hook_impl_test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/commands/hook_impl_test.py b/tests/commands/hook_impl_test.py index b0159f8..3e20874 100644 --- a/tests/commands/hook_impl_test.py +++ b/tests/commands/hook_impl_test.py @@ -242,6 +242,18 @@ def test_run_ns_pre_push_new_branch_existing_rev(push_example): assert ns is None +def test_run_ns_pre_push_ref_with_whitespace(push_example): + src, src_head, clone, _ = push_example + + with cwd(clone): + args = ('origin', src) + line = f'HEAD^{{/ }} {src_head} refs/heads/b2 {hook_impl.Z40}\n' + stdin = line.encode() + ns = hook_impl._run_ns('pre-push', False, args, stdin) + + assert ns is None + + def test_pushing_orphan_branch(push_example): src, src_head, clone, _ = push_example |