From: Hangbin Liu <hangbin.liu@linux.dev>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Hangbin Liu <hangbin.liu@linux.dev>,
Hangbin Liu <liuhangbin@kylinos.cn>
Subject: [PATCH b4] tests: pin scratch repos to master regardless of init.defaultBranch
Date: Tue, 20 Oct 2026 17:56:30 +0800 [thread overview]
Message-ID: <20261020-test_base_commit-v1-1-083fa909c424@kylinos.cn> (raw)
From: Hangbin Liu <liuhangbin@kylinos.cn>
_init_repo() ran a plain "git init", so the scratch repo's initial
branch followed the developer's init.defaultBranch. On a machine
configured with init.defaultBranch=main (increasingly the norm), the
repos come up on main, and test_base_commit_in_remote_tree then fails
at its "git checkout master".
Pins -b master on the local side so the suite passes regardless of the
developer's default-branch configuration.
Assisted-by: LLM [analysis, codegen]
Fixes: 4ee47be995f2 ("ty: verify queued-thanks commits by ref reachability, not HTTP status")
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
src/tests/test_ty.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tests/test_ty.py b/src/tests/test_ty.py
index 269ce021306f..2901f053f0f5 100644
--- a/src/tests/test_ty.py
+++ b/src/tests/test_ty.py
@@ -401,7 +401,9 @@ def test_get_check_repo_config_override(monkeypatch: pytest.MonkeyPatch) -> None
def _init_repo(path: str) -> None:
- ecode, out = b4.git_run_command(None, ['init', path])
+ # -b master: some tests check out "master" by name, and an
+ # init.defaultBranch of 'main' would leave no such branch to find.
+ ecode, out = b4.git_run_command(None, ['init', '-b', 'master', path])
assert ecode == 0, out
b4.git_set_config(path, 'user.name', 'Test')
b4.git_set_config(path, 'user.email', 'test@example.com')
---
base-commit: 6be7c6139d7734d84afddf989fa2874935b6d85b
change-id: 20261020-test_base_commit-d258e41c094a
Best regards,
--
Hangbin Liu <liuhangbin@kylinos.cn>
reply other threads:[~2026-10-20 9:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261020-test_base_commit-v1-1-083fa909c424@kylinos.cn \
--to=hangbin.liu@linux.dev \
--cc=liuhangbin@kylinos.cn \
--cc=tools@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox