Create a new branch.
(repo_path: &Path, name: &str, base: &str)
| 517 | |
| 518 | /// Create a new branch. |
| 519 | pub fn create_branch(repo_path: &Path, name: &str, base: &str) -> Result<()> { |
| 520 | let (success, _, stderr) = run_git(repo_path, &["checkout", "-b", name, base])?; |
| 521 | if !success && !stderr.is_empty() { |
| 522 | return Err(anyhow!("Failed to create branch: {}", stderr)); |
| 523 | } |
| 524 | Ok(()) |
| 525 | } |
| 526 | |
| 527 | /// Worktree information. |
| 528 | #[derive(Debug, Clone)] |
no test coverage detected