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:
@@ -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"},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user