All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH b4] tests: pin scratch repos to master regardless of init.defaultBranch
@ 2026-10-20  9:56 Hangbin Liu
  0 siblings, 0 replies; only message in thread
From: Hangbin Liu @ 2026-10-20  9:56 UTC (permalink / raw)
  To: Kernel.org Tools; +Cc: Hangbin Liu, Hangbin Liu

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>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-20  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20  9:56 [PATCH b4] tests: pin scratch repos to master regardless of init.defaultBranch Hangbin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.