(dir: &Path, args: &[&str])
| 182 | } |
| 183 | |
| 184 | fn git_output(dir: &Path, args: &[&str]) -> Option<String> { |
| 185 | let output = git_command().args(args).current_dir(dir).output().ok()?; |
| 186 | if !output.status.success() { |
| 187 | return None; |
| 188 | } |
| 189 | let raw = String::from_utf8(output.stdout).ok()?; |
| 190 | let trimmed = raw.trim(); |
| 191 | (!trimmed.is_empty()).then(|| trimmed.to_string()) |
| 192 | } |
| 193 | |
| 194 | #[cfg(test)] |
| 195 | #[allow(clippy::unwrap_used, clippy::expect_used)] |
no test coverage detected