MCPcopy Index your code
hub / github.com/AI45Lab/Code / create_branch

Function create_branch

core/src/git.rs:519–525  ·  view source on GitHub ↗

Create a new branch.

(repo_path: &Path, name: &str, base: &str)

Source from the content-addressed store, hash-verified

517
518/// Create a new branch.
519pub 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)]

Callers 1

create_branchMethod · 0.85

Calls 2

run_gitFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected