switchBranch switches to the specified branch
(branchName string, verbose bool)
| 475 | |
| 476 | // switchBranch switches to the specified branch |
| 477 | func switchBranch(branchName string, verbose bool) error { |
| 478 | console.LogVerbose(verbose, "Switching to branch: "+branchName) |
| 479 | |
| 480 | cmd := exec.Command("git", "checkout", branchName) |
| 481 | if err := cmd.Run(); err != nil { |
| 482 | return fmt.Errorf("failed to switch to branch %s: %w", branchName, err) |
| 483 | } |
| 484 | |
| 485 | return nil |
| 486 | } |
| 487 | |
| 488 | // commitChanges commits all staged changes with the given message |
| 489 | func commitChanges(message string, verbose bool) error { |