(root: &Path, args: &[&str])
| 121 | } |
| 122 | |
| 123 | fn git(root: &Path, args: &[&str]) -> String { |
| 124 | let output = Command::new("git") |
| 125 | .args(args) |
| 126 | .current_dir(root) |
| 127 | .env("GIT_AUTHOR_NAME", "CB-9C Tests") |
| 128 | .env("GIT_AUTHOR_EMAIL", "cb9c@example.com") |
| 129 | .env("GIT_COMMITTER_NAME", "CB-9C Tests") |
| 130 | .env("GIT_COMMITTER_EMAIL", "cb9c@example.com") |
| 131 | .output() |
| 132 | .expect("run git"); |
| 133 | assert!( |
| 134 | output.status.success(), |
| 135 | "git {args:?} failed: {}", |
| 136 | String::from_utf8_lossy(&output.stderr) |
| 137 | ); |
| 138 | String::from_utf8(output.stdout) |
| 139 | .expect("utf8 git output") |
| 140 | .trim() |
| 141 | .to_string() |
| 142 | } |
| 143 | |
| 144 | fn git_commit(root: &Path, message: &str) -> String { |
| 145 | git(root, &["add", "-A", "--"]); |
no test coverage detected