mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
Override the developer's global git branch name in tests
Setting "main" as a default branch name is getting more common. The no_commit_to_branch tests depend on this being the default.
This commit is contained in:
parent
51e14fcc97
commit
31e32bc0af
1 changed files with 8 additions and 1 deletions
|
|
@ -6,5 +6,12 @@ from pre_commit_hooks.util import cmd_output
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def temp_git_dir(tmpdir):
|
def temp_git_dir(tmpdir):
|
||||||
git_dir = tmpdir.join('gits')
|
git_dir = tmpdir.join('gits')
|
||||||
cmd_output('git', 'init', '--', str(git_dir))
|
cmd_output(
|
||||||
|
'git',
|
||||||
|
'-c',
|
||||||
|
'init.defaultBranch=master',
|
||||||
|
'init',
|
||||||
|
'--',
|
||||||
|
str(git_dir),
|
||||||
|
)
|
||||||
yield git_dir
|
yield git_dir
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue