From 2e0a855ffd8c6e67a937f51c76be01bf95424b39 Mon Sep 17 00:00:00 2001 From: James Arama Date: Tue, 9 Jun 2026 15:25:47 -0700 Subject: [PATCH] fix(tests): pin new-overlay bare-repo fixture HEAD to main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new-overlay.bats setup() built its hermetic submodule source with `git init --bare` (no -b), so the bare repo's HEAD followed the ambient init.defaultBranch. The fixture pushes its only commit to `main`, but Ubuntu CI's git defaults to `master`, leaving HEAD on an empty branch. `git submodule add` then hit "fatal: unable to checkout submodule '.claude/dotfiles-core'" (branch yet to be born), failing tests 190 and 191. It passed locally only because the dev's global init.defaultBranch happened to be `main`. Pin the bare HEAD with `-b main` so it matches the push target, making the fixture environment-independent. Verified green under both init.defaultBranch=master (simulated CI) and =main (dev): 9/9 in new-overlay.bats, full suite unaffected. Latent fixture bug from #12 (32a4bc0); today's run was the first CI to include these tests. Test assertions unchanged — only the fixture. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/new-overlay.bats | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/new-overlay.bats b/tests/new-overlay.bats index 3e7de81..5afd365 100644 --- a/tests/new-overlay.bats +++ b/tests/new-overlay.bats @@ -51,7 +51,11 @@ setup() { git config --global protocol.file.allow always BARE="$SCRATCH/fake-core.git" - git init --bare "$BARE" -q + # -b main pins HEAD to match the push target (HEAD:main below); without it, + # git uses init.defaultBranch which defaults to "master" on Ubuntu CI, + # making the bare repo's HEAD point at an empty branch and causing + # "fatal: unable to checkout submodule" when git submodule add runs. + git init --bare "$BARE" -q -b main local work="$SCRATCH/seed" git clone "$BARE" "$work" -q echo "core" > "$work/marker"