(ctx *snap.Context)
| 2584 | } |
| 2585 | |
| 2586 | func runCommitPush(ctx *snap.Context) error { |
| 2587 | if ctx.NArgs() != 0 { |
| 2588 | return reportError(ctx, fmt.Errorf("Usage: %s commitPush", commandName)) |
| 2589 | } |
| 2590 | |
| 2591 | payload, err := prepareCommit(ctx) |
| 2592 | if err != nil { |
| 2593 | return err |
| 2594 | } |
| 2595 | |
| 2596 | printProposedMessage(ctx, payload.message) |
| 2597 | if err := commitWithPayload(ctx, payload); err != nil { |
| 2598 | return err |
| 2599 | } |
| 2600 | printCommitSuccess(ctx, payload) |
| 2601 | |
| 2602 | if err := runGitCommandStreaming(ctx, "push"); err != nil { |
| 2603 | return reportError(ctx, fmt.Errorf("git push: %w", err)) |
| 2604 | } |
| 2605 | |
| 2606 | fmt.Fprintln(ctx.Stdout(), "✔️ Pushed") |
| 2607 | return nil |
| 2608 | } |
| 2609 | |
| 2610 | func runCommitReviewAndPush(ctx *snap.Context) error { |
| 2611 | if ctx.NArgs() != 0 { |
no test coverage detected