[PATCH b4 v2 27/44] tests: pin the default branch in the queue-delivery fixture
Christian Brauner <[email protected]> Fri, 31 Jul 2026 23:59:08 +0200
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <20260731-work-b4-editor-branch-guard-v2-27-243fd19d322d@kernel.org> |
The fixture pushes to refs/heads/master but creates the bare repository with a plain "git init --bare", so any other init.defaultBranch leaves the clone on an unborn branch and the test fails during setup. Name the initial branch. Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- src/tests/test_ty.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/test_ty.py b/src/tests/test_ty.py index 968d672..8ca5184 100644 --- a/src/tests/test_ty.py +++ b/src/tests/test_ty.py @@ -355,7 +355,10 @@ def test_commit_reachable_unknown_tips( pub = str(tmp_path / 'pub') other = str(tmp_path / 'other') _init_repo(local) - ecode, out = b4.git_run_command(None, ['init', '--bare', pub]) + # -b master: the clone below takes its HEAD from this repository, and an + # init.defaultBranch of 'main' would leave it on an unborn branch, with + # the "advance the remote" commit landing as an unrelated root commit. + ecode, out = b4.git_run_command(None, ['init', '--bare', '-b', 'master', pub]) assert ecode == 0, out monkeypatch.chdir(local) c1 = _commit_empty('c1') -- 2.53.0