Skip to content

ci: set init.defaultBranch=main so temp-repo tests match branch guard - #65

Merged
utx0 merged 8 commits into
mainfrom
metta/set-git-init-defaultbranch-main-ci-gates-job
Aug 8, 2026
Merged

ci: set init.defaultBranch=main so temp-repo tests match branch guard#65
utx0 merged 8 commits into
mainfrom
metta/set-git-init-defaultbranch-main-ci-gates-job

Conversation

@utx0

@utx0 utx0 commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Final piece of the CI rollout (#62, #64). The gates job still failed CI-only on tests/cli-roadmap.test.ts (16/18) and tests/cli-issue-backlog.test.ts (13/28): GitHub runners have no init.defaultBranch, so temp repos created by metta install --git-init land on master, tripping metta's main-branch write guard (src/cli/helpers.ts) with exit 4 for issue/backlog/roadmap commands. Developer machines mask this via global init.defaultBranch=main.

Fix: one line added to the gates job's git config step — git config --global init.defaultBranch main.

Verification

  • Isolated-HOME simulation mirroring the runner: 29/46 fail without the setting (exact CI symptom: "Refusing to write: current branch 'master' is not the main branch 'main'"), 46/46 pass with it
  • Finalize gates: tests 1859/1859, lint, typecheck, build all pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01AA8wwFpob25iYZFCBBEtKK

ryder and others added 8 commits August 9, 2026 00:27
GitHub-hosted runners have no init.defaultBranch, so temp repos created
by `metta install --git-init` in tests land on master and trip metta's
branch write-guard (exit 4), failing tests/cli-roadmap.test.ts and
tests/cli-issue-backlog.test.ts. Setting the default in the gates job's
git config step makes the runner match typical developer config.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AA8wwFpob25iYZFCBBEtKK
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AA8wwFpob25iYZFCBBEtKK
@utx0
utx0 merged commit 1a664d1 into main Aug 8, 2026
3 of 4 checks passed
@utx0
utx0 deleted the metta/set-git-init-defaultbranch-main-ci-gates-job branch August 8, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant