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

Function run_git

core/src/git.rs:394–407  ·  view source on GitHub ↗

Run a git command.

(repo_path: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

392
393/// Run a git command.
394fn run_git(repo_path: &Path, args: &[&str]) -> Result<(bool, String, String)> {
395 ensure_git_installed()?;
396
397 let output = Command::new("git")
398 .args(["-C", &repo_path.display().to_string()])
399 .args(args)
400 .output()
401 .map_err(|e| anyhow!("Failed to execute git: {}", e))?;
402
403 let stdout = String::from_utf8_lossy(&output.stdout).to_string();
404 let stderr = String::from_utf8_lossy(&output.stderr).to_string();
405
406 Ok((output.status.success(), stdout, stderr))
407}
408
409// ==================== Git Operations ====================
410

Callers 10

get_statusFunction · 0.85
get_logFunction · 0.85
list_branchesFunction · 0.85
create_branchFunction · 0.85
list_worktreesFunction · 0.85
create_worktreeFunction · 0.85
remove_worktreeFunction · 0.85
get_diffFunction · 0.85
list_stashesFunction · 0.85
stashFunction · 0.85

Calls 2

ensure_git_installedFunction · 0.85
successMethod · 0.45

Tested by

no test coverage detected