Skip pushing merges when the repo has no remote

This commit is contained in:
Ian Gulliver
2026-10-22 18:05:52 -07:00
parent f3b15696b3
commit da7f324bab
6 changed files with 69 additions and 15 deletions
+9 -3
View File
@@ -102,7 +102,10 @@ func (m *Manager) mergeToMain(ctx context.Context, l *live, raw json.RawMessage)
return fmt.Sprintf("Nothing to push: %s already has all of this branch's work, so byre merged %s into this branch. Keep working; the task stays open.", project.DefaultBranch, project.DefaultBranch), nil
}
pushed := git.Remote + "/" + project.DefaultBranch
pushed, err := git.Upstream(ctx, project.RepoPath, project.DefaultBranch)
if err != nil {
return "", err
}
err = m.emit(ctx, l, agentActor, "task.merged_to_main", map[string]any{"id": task.Id, "commit": commit, "pushed": pushed, "merge_title": title})
if err != nil {
return "", err
@@ -142,8 +145,11 @@ func (m *Manager) pushToMain(ctx context.Context, l *live, task api.Task, projec
return "", err
}
pushed := git.Remote + "/" + project.DefaultBranch
err = advanceMainCheckout(project, commit, notes)
pushed, err := git.Upstream(ctx, project.RepoPath, project.DefaultBranch)
if err != nil {
return "", err
}
err = advanceMainCheckout(project, commit, notes, pushed)
if err != nil {
return "", err
}