(root: &Path, args: &[&str])
| 82 | } |
| 83 | |
| 84 | fn git(root: &Path, args: &[&str]) -> String { |
| 85 | let output = Command::new("git") |
| 86 | .args(args) |
| 87 | .current_dir(root) |
| 88 | .env("GIT_AUTHOR_NAME", "CB-9B Tests") |
| 89 | .env("GIT_AUTHOR_EMAIL", "cb9b@example.com") |
| 90 | .env("GIT_COMMITTER_NAME", "CB-9B Tests") |
| 91 | .env("GIT_COMMITTER_EMAIL", "cb9b@example.com") |
| 92 | .output() |
| 93 | .expect("run git"); |
| 94 | assert!( |
| 95 | output.status.success(), |
| 96 | "git {args:?} failed: {}", |
| 97 | String::from_utf8_lossy(&output.stderr) |
| 98 | ); |
| 99 | String::from_utf8(output.stdout) |
| 100 | .expect("utf8 git output") |
| 101 | .trim() |
| 102 | .to_string() |
| 103 | } |
| 104 | |
| 105 | fn git_commit(root: &Path, message: &str) -> String { |
| 106 | git(root, &["add", "."]); |
no test coverage detected