fix: Use --initial-branch=main in rig integration tests

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 <noreply@anthropic.com>
This commit is contained in:
goose
2026-01-05 07:23:06 -08:00
committed by Mike Lady
parent 7ae08ed219
commit 52533c354d

View File

@@ -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"},
}