(project: &Path, args: &[&str])
| 117 | } |
| 118 | |
| 119 | fn git(project: &Path, args: &[&str]) { |
| 120 | let output = Command::new("git") |
| 121 | .args(["-c", "core.hooksPath=.git/no-hooks"]) |
| 122 | .args(args) |
| 123 | .current_dir(project) |
| 124 | .output() |
| 125 | .unwrap_or_else(|e| panic!("failed to run git {args:?}: {e}")); |
| 126 | assert!( |
| 127 | output.status.success(), |
| 128 | "git {args:?} failed\nstdout:\n{}\nstderr:\n{}", |
| 129 | String::from_utf8_lossy(&output.stdout), |
| 130 | String::from_utf8_lossy(&output.stderr) |
| 131 | ); |
| 132 | } |
| 133 | |
| 134 | fn commit_all(project: &Path, message: &str) { |
| 135 | git(project, &["add", "."]); |
no test coverage detected