mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
no-commit-to-branch: Default to both master and main
This commit is contained in:
parent
51e14fcc97
commit
3abbd4785c
3 changed files with 9 additions and 2 deletions
|
|
@ -67,3 +67,10 @@ def test_not_on_a_branch(temp_git_dir):
|
|||
cmd_output('git', 'checkout', head)
|
||||
# we're not on a branch!
|
||||
assert main(()) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize('branch_name', ('master', 'main'))
|
||||
def test_default_branch_names(temp_git_dir, branch_name):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', branch_name)
|
||||
assert main(()) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue