diff --git a/internal/cmd/mq_submit.go b/internal/cmd/mq_submit.go index cdc49eb7..46191dff 100644 --- a/internal/cmd/mq_submit.go +++ b/internal/cmd/mq_submit.go @@ -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)