mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-08 04:34:16 +00:00
fix tests to handle default branch main or master
This commit is contained in:
parent
31903eabdb
commit
c96572c378
3 changed files with 24 additions and 6 deletions
|
|
@ -7,10 +7,14 @@ import pytest
|
|||
|
||||
from pre_commit_hooks.check_merge_conflict import main
|
||||
from pre_commit_hooks.util import cmd_output
|
||||
from testing.util import get_default_branch
|
||||
from testing.util import get_resource_path
|
||||
from testing.util import git_commit
|
||||
|
||||
|
||||
default_branch = get_default_branch()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def f1_is_a_conflict_file(tmpdir):
|
||||
# Make a merge conflict
|
||||
|
|
@ -150,7 +154,12 @@ def test_worktree_merge_conflicts(f1_is_a_conflict_file, tmpdir, capsys):
|
|||
cmd_output('git', 'worktree', 'add', str(worktree))
|
||||
with worktree.as_cwd():
|
||||
cmd_output(
|
||||
'git', 'pull', '--no-rebase', 'origin', 'master', retcode=None,
|
||||
'git',
|
||||
'pull',
|
||||
'--no-rebase',
|
||||
'origin',
|
||||
default_branch,
|
||||
retcode=None,
|
||||
)
|
||||
msg = f1_is_a_conflict_file.join('.git/worktrees/worktree/MERGE_MSG')
|
||||
assert msg.exists()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue