Runs a git command in the repository directory.
(&self, args: &[&str])
| 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 | |
| 88 | impl TestGitRepository { |
no test coverage detected