fix: Witness checks all remotes for merge verification (gt-ncq26)

In multi-remote setups, the code may live on a remote other than
"origin" (e.g., "gastown" for gastown.git). The verifyCommitOnMain
function now iterates through all configured remotes to find the
one containing the default branch with the merged commit.

Changes:
- Add git.Remotes() method to list all configured remote names
- Update verifyCommitOnMain to check all remotes/<defaultBranch>
  instead of only origin/<defaultBranch>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
chumbucket
2026-01-04 15:12:44 -08:00
committed by Steve Yegge
parent 00d73b8f8c
commit 507402dfca
2 changed files with 39 additions and 6 deletions

View File

@@ -299,6 +299,18 @@ func (g *Git) RemoteURL(remote string) (string, error) {
return g.run("remote", "get-url", remote)
}
// Remotes returns the list of configured remote names.
func (g *Git) Remotes() ([]string, error) {
out, err := g.run("remote")
if err != nil {
return nil, err
}
if out == "" {
return nil, nil
}
return strings.Split(out, "\n"), nil
}
// Merge merges the given branch into the current branch.
func (g *Git) Merge(branch string) error {
_, err := g.run("merge", branch)