runAutoPush returns a tea.Cmd that pushes the branch in the background.
()
| 1395 | |
| 1396 | // runAutoPush returns a tea.Cmd that pushes the branch in the background. |
| 1397 | func (a *App) runAutoPush() tea.Cmd { |
| 1398 | branch := a.completionScreen.Branch() |
| 1399 | // Use worktree dir if available, otherwise base dir |
| 1400 | dir := a.baseDir |
| 1401 | if instance := a.manager.GetInstance(a.completionScreen.PRDName()); instance != nil && instance.WorktreeDir != "" { |
| 1402 | dir = instance.WorktreeDir |
| 1403 | } |
| 1404 | return func() tea.Msg { |
| 1405 | err := git.PushBranch(dir, branch) |
| 1406 | return autoActionResultMsg{action: "push", err: err} |
| 1407 | } |
| 1408 | } |
| 1409 | |
| 1410 | // runAutoCreatePR returns a tea.Cmd that creates a PR in the background. |
| 1411 | func (a *App) runAutoCreatePR() tea.Cmd { |
no test coverage detected