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