Skip pushing merges when the repo has no remote
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user