Skip to content

Commit c1e189d

Browse files
authored
tests: make test independent of git setting of default branch (#10656)
1 parent a6c33a1 commit c1e189d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/vcs/git/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@pytest.fixture()
1616
def temp_repo(tmp_path: Path) -> TempRepoFixture:
1717
"""Temporary repository with 2 commits"""
18-
repo = dulwich.repo.Repo.init(str(tmp_path))
18+
repo = dulwich.repo.Repo.init(str(tmp_path), default_branch=b"main")
1919
worktree = repo.get_worktree()
2020

2121
# init commit

tests/vcs/git/test_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_clone_existing_locked_tag(tmp_path: Path, temp_repo: TempRepoFixture) -
276276
Git.clone(url=source_url, source_root=source_root_dir, name="clone-test")
277277

278278
expected_short = (
279-
f"Failed to clone {source_url} at 'refs/heads/master',"
279+
f"Failed to clone {source_url} at 'refs/heads/main',"
280280
f" unable to acquire file lock for {tag_ref}."
281281
)
282282
assert str(exc_info.value) == expected_short

0 commit comments

Comments
 (0)