From 52533c354d15b606cb3bfcfbae8429b38cda0b7d Mon Sep 17 00:00:00 2001 From: goose Date: Mon, 5 Jan 2026 07:23:06 -0800 Subject: [PATCH] fix: Use --initial-branch=main in rig integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test helper createTestGitRepo was using plain `git init` which creates a branch based on the system's init.defaultBranch config. When AddRig tries to detect and checkout the default branch, it falls back to "main" if detection fails, causing "pathspec 'main' did not match" errors in CI where the system default is "master". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/rig_integration_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cmd/rig_integration_test.go b/internal/cmd/rig_integration_test.go index 40f470cf..4924709a 100644 --- a/internal/cmd/rig_integration_test.go +++ b/internal/cmd/rig_integration_test.go @@ -30,9 +30,10 @@ func createTestGitRepo(t *testing.T, name string) string { t.Fatalf("mkdir repo: %v", err) } - // Initialize git repo + // Initialize git repo with explicit main branch + // (system default may vary, causing checkout failures) cmds := [][]string{ - {"git", "init"}, + {"git", "init", "--initial-branch=main"}, {"git", "config", "user.email", "test@test.com"}, {"git", "config", "user.name", "Test User"}, }