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

Method run_git_command

core/src/workspace/local.rs:548–566  ·  view source on GitHub ↗
(&self, args: Vec<String>)

Source from the content-addressed store, hash-verified

546 }
547
548 async fn run_git_command(&self, args: Vec<String>) -> Result<(bool, String, String)> {
549 tokio::task::spawn_blocking(crate::git::ensure_git_installed)
550 .await
551 .map_err(|e| anyhow!("Git worker failed: {}", e))??;
552
553 let output = tokio::process::Command::new("git")
554 .arg("-C")
555 .arg(self.root.as_os_str())
556 .args(&args)
557 .output()
558 .await
559 .map_err(|e| anyhow!("Failed to execute git: {}", e))?;
560
561 Ok((
562 output.status.success(),
563 String::from_utf8_lossy(&output.stdout).to_string(),
564 String::from_utf8_lossy(&output.stderr).to_string(),
565 ))
566 }
567}
568
569fn parse_git_remote_line(line: &str) -> Option<WorkspaceGitRemote> {

Callers 2

checkoutMethod · 0.80
list_remotesMethod · 0.80

Calls 1

successMethod · 0.45

Tested by

no test coverage detected