(root: &Path, args: &[&str])
| 49 | } |
| 50 | |
| 51 | fn git(root: &Path, args: &[&str]) -> String { |
| 52 | let output = Command::new("git") |
| 53 | .args(args) |
| 54 | .current_dir(root) |
| 55 | .env("GIT_AUTHOR_NAME", "Tree Shape Tests") |
| 56 | .env("GIT_AUTHOR_EMAIL", "tree-shape@example.com") |
| 57 | .env("GIT_COMMITTER_NAME", "Tree Shape Tests") |
| 58 | .env("GIT_COMMITTER_EMAIL", "tree-shape@example.com") |
| 59 | .output() |
| 60 | .expect("run git"); |
| 61 | assert!( |
| 62 | output.status.success(), |
| 63 | "git {args:?} failed: {}", |
| 64 | String::from_utf8_lossy(&output.stderr) |
| 65 | ); |
| 66 | String::from_utf8(output.stdout) |
| 67 | .expect("utf8 git output") |
| 68 | .trim() |
| 69 | .to_string() |
| 70 | } |
| 71 | |
| 72 | fn git_repo() -> (PathBuf, PathBuf) { |
| 73 | let root = tempfile::tempdir().unwrap().keep(); |
no test coverage detected