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