Skip to content

Commit

Permalink
Override the developer's global git branch name in tests
Browse files Browse the repository at this point in the history
Setting "main" as a default branch name is getting more common. The
no_commit_to_branch tests depend on this being the default.
  • Loading branch information
ndevenish committed Mar 4, 2021
1 parent 51e14fc commit 31e32bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
@pytest.fixture
def temp_git_dir(tmpdir):
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

0 comments on commit 31e32bc

Please sign in to comment.