fix(mq): Add push verification before MR submission (gt-2hwi9)
CRITICAL: Prevents work loss from unpushed commits. The bug: gt mq submit created MR beads without verifying the branch was pushed to remote. This allowed polecats to create MR beads for unpushed work, which the Refinery would skip and the Witness would nuke, losing work. The fix: Add same push verification that gt done uses. Now both code paths require git push before MR submission. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,17 @@ func runMqSubmit(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("cannot submit main/master branch to merge queue")
|
||||
}
|
||||
|
||||
// CRITICAL: Verify branch is pushed before creating MR bead
|
||||
// This prevents work loss when MR is created but commits aren't on remote.
|
||||
// See: gt-2hwi9 (Polecats not pushing before signaling done)
|
||||
pushed, unpushedCount, err := g.BranchPushedToRemote(branch, "origin")
|
||||
if err != nil {
|
||||
return fmt.Errorf("checking if branch is pushed: %w", err)
|
||||
}
|
||||
if !pushed {
|
||||
return fmt.Errorf("branch has %d unpushed commit(s); run 'git push -u origin %s' first", unpushedCount, branch)
|
||||
}
|
||||
|
||||
// Parse branch info
|
||||
info := parseBranchName(branch)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user