mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Adding support for branches with a slash in them.
This commit is contained in:
parent
28c3288ba8
commit
878e45021d
2 changed files with 13 additions and 1 deletions
|
|
@ -12,6 +12,18 @@ def test_other_branch(temp_git_dir):
|
|||
assert is_on_branch('master') is False
|
||||
|
||||
|
||||
def test_multi_branch(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', 'another/branch')
|
||||
assert is_on_branch('master') is False
|
||||
|
||||
|
||||
def test_multi_branch_fail(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', 'another/branch')
|
||||
assert is_on_branch('another/branch') is True
|
||||
|
||||
|
||||
def test_master_branch(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
assert is_on_branch('master') is True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue