(root: &Path, args: &[&str])
| 56 | } |
| 57 | |
| 58 | fn git(root: &Path, args: &[&str]) -> String { |
| 59 | let output = Command::new("git") |
| 60 | .args(args) |
| 61 | .current_dir(root) |
| 62 | .env("GIT_AUTHOR_NAME", "CB-7A Tests") |
| 63 | .env("GIT_AUTHOR_EMAIL", "cb7a@example.com") |
| 64 | .env("GIT_COMMITTER_NAME", "CB-7A Tests") |
| 65 | .env("GIT_COMMITTER_EMAIL", "cb7a@example.com") |
| 66 | .output() |
| 67 | .expect("run git"); |
| 68 | assert!( |
| 69 | output.status.success(), |
| 70 | "git {args:?} failed: {}", |
| 71 | String::from_utf8_lossy(&output.stderr) |
| 72 | ); |
| 73 | String::from_utf8(output.stdout) |
| 74 | .expect("utf8 git output") |
| 75 | .trim() |
| 76 | .to_string() |
| 77 | } |
| 78 | |
| 79 | fn git_ok(root: &Path, args: &[&str]) { |
| 80 | let _ = git(root, args); |
no test coverage detected