From 6c8f510b615786e9eab506550d99e26eab16064e Mon Sep 17 00:00:00 2001 From: Simon Wright Date: Fri, 27 Jan 2023 14:26:35 +0000 Subject: [PATCH] Specify the initial branch for test repos. (#1244) Reason: the git in macOS Xcode 14 defaults the initial branch to 'main', but the tests assume 'master'. * testsuite/drivers/helpers.py (init_git_repo): check out the branch 'master'. --- testsuite/drivers/helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testsuite/drivers/helpers.py b/testsuite/drivers/helpers.py index 0380902a..c82bc5a3 100644 --- a/testsuite/drivers/helpers.py +++ b/testsuite/drivers/helpers.py @@ -179,6 +179,9 @@ def init_git_repo(path): start_cwd = os.getcwd() os.chdir(path) assert run(["git", "init", "."]).returncode == 0 + # You might think to init with --initial-branch=master, but + # e.g. Centos's git doesn't support this. + assert run(["git", "checkout", "-b", "master"]).returncode == 0 assert run(["git", "config", "user.email", "alr@testing.com"]) \ .returncode == 0 assert run(["git", "config", "user.name", "Alire Testsuite"]) \ -- 2.39.5