(dir: &Path, args: &[&str])
| 3 | use std::process::Command; |
| 4 | |
| 5 | fn git(dir: &Path, args: &[&str]) -> Option<String> { |
| 6 | let output = Command::new("git") |
| 7 | .arg("-C") |
| 8 | .arg(dir) |
| 9 | .args(args) |
| 10 | .output() |
| 11 | .ok()?; |
| 12 | if !output.status.success() { |
| 13 | return None; |
| 14 | } |
| 15 | String::from_utf8(output.stdout).ok() |
| 16 | } |
| 17 | |
| 18 | fn short_commit(commit: &str) -> Option<&str> { |
| 19 | let commit = commit.trim(); |
no test coverage detected