mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-14 11:59:47 +03:00
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:
parent
d32be64820
commit
78b78410a4
2 changed files with 7 additions and 7 deletions
|
@ -35,16 +35,16 @@ def prepare_tmpdir(args, monkeypatch, tmpdir):
|
|||
|
||||
def run_git(git_args, repo="local"):
|
||||
path = tmpdir + "/" + repo
|
||||
pmb.helpers.run.user(args, ["git"] + git_args, path, "stdout")
|
||||
pmb.helpers.run.user(args, ["git"] + git_args, path, "stdout", output_return=True)
|
||||
|
||||
# Remote repos
|
||||
run_git(["init", "."], "remote")
|
||||
run_git(["init", "-b", "master", "."], "remote")
|
||||
run_git(["commit", "--allow-empty", "-m", "commit: remote"], "remote")
|
||||
run_git(["init", "."], "remote2")
|
||||
run_git(["init", "-b", "master", "."], "remote2")
|
||||
run_git(["commit", "--allow-empty", "-m", "commit: remote2"], "remote2")
|
||||
|
||||
# Local repo (with master -> origin2/master)
|
||||
run_git(["init", "."])
|
||||
run_git(["init", "-b", "master", "."])
|
||||
run_git(["remote", "add", "-f", "origin", path_remote])
|
||||
run_git(["remote", "add", "-f", "origin2", path_remote2])
|
||||
run_git(["checkout", "-b", "master", "--track", "origin2/master"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue