test: specify default git branch

don't assume that master is the default branch name.

Signed-off-by: Caleb Connolly <kc@postmarketos.org>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230629-suffix-type-hint-v1-3-e92802ae20a8@postmarketos.org%3E
This commit is contained in:
Caleb Connolly 2023-07-12 23:09:09 +01:00 committed by Oliver Smith
parent d32be64820
commit 78b78410a4
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 7 additions and 7 deletions

View file

@ -44,7 +44,7 @@ def test_can_fast_forward(args, tmpdir):
pmb.helpers.run.user(args, ["git"] + git_args, tmpdir, "stdout")
# Create test git repo
run_git(["init", "."])
run_git(["init", "-b", "master", "."])
run_git(["commit", "--allow-empty", "-m", "commit on master"])
run_git(["checkout", "-b", branch_origin])
run_git(["commit", "--allow-empty", "-m", "commit on branch_origin"])
@ -71,7 +71,7 @@ def test_clean_worktree(args, tmpdir):
pmb.helpers.run.user(args, ["git"] + git_args, tmpdir, "stdout")
# Create test git repo
run_git(["init", "."])
run_git(["init", "-b", "master", "."])
run_git(["commit", "--allow-empty", "-m", "commit on master"])
assert func(args, tmpdir) is True
@ -98,7 +98,7 @@ def test_get_upstream_remote(args, monkeypatch, tmpdir):
pmb.helpers.run.user(args, ["git"] + git_args, tmpdir, "stdout")
# Create git repo
run_git(["init", "."])
run_git(["init", "-b", "master", "."])
run_git(["commit", "--allow-empty", "-m", "commit on master"])
# No upstream remote