MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / run_git_command

Method run_git_command

src/test_utils/git_test_utils.rs:72–85  ·  view source on GitHub ↗

Runs a git command in the repository directory.

(&self, args: &[&str])

Source from the content-addressed store, hash-verified

70
71 /// Runs a git command in the repository directory.
72 pub fn run_git_command(&self, args: &[&str]) -> Result<String> {
73 let output = Command::new("git")
74 .args(args)
75 .current_dir(&self.repo_path)
76 .output()
77 .context("Failed to execute git command")?;
78
79 if !output.status.success() {
80 let stderr = String::from_utf8_lossy(&output.stderr);
81 anyhow::bail!("Git command failed: {}", stderr);
82 }
83
84 Ok(String::from_utf8_lossy(&output.stdout).to_string())
85 }
86}
87
88impl TestGitRepository {

Calls 1

successMethod · 0.80

Tested by

no test coverage detected