Skip to content

Commit 676ff8b

Browse files
committed
test: set branch name for metadata tests
Explicitly set the initial branch name for git repos created when testing metadata. Without this, the user's git config may cause test failures.
1 parent a27ac29 commit 676ff8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

appmap/test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def git_directory_fixture(tmp_path_factory):
7777
(git_dir / "new_file").write_text("new_file")
7878

7979
git = utils.git(cwd=git_dir)
80-
git("init")
80+
git("init --initial-branch main")
8181
git("config --local user.email test@test")
8282
git("config --local user.name Test")
8383
git("add README.metadata")

appmap/test/test_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_git_metadata(git):
2323
assert git_md == DictIncluding(
2424
{
2525
"repository": "https://www.example.test/repo.git",
26-
"branch": "master",
26+
"branch": "main",
2727
"status": ["?? new_file"],
2828
}
2929
)
@@ -55,7 +55,7 @@ def test_tags(git):
5555
assert git_md == DictIncluding(
5656
{
5757
"repository": "https://www.example.test/repo.git",
58-
"branch": "master",
58+
"branch": "main",
5959
"tag": tag,
6060
"annotated_tag": atag,
6161
"commits_since_tag": 1,

0 commit comments

Comments
 (0)