mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Setting "main" as a default branch name is getting more common. The no_commit_to_branch tests depend on this being the default.
17 lines
296 B
Python
17 lines
296 B
Python
import pytest
|
|
|
|
from pre_commit_hooks.util import cmd_output
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_git_dir(tmpdir):
|
|
git_dir = tmpdir.join('gits')
|
|
cmd_output(
|
|
'git',
|
|
'-c',
|
|
'init.defaultBranch=master',
|
|
'init',
|
|
'--',
|
|
str(git_dir),
|
|
)
|
|
yield git_dir
|