(root: &Path, args: &[&str])
| 47 | } |
| 48 | |
| 49 | fn git(root: &Path, args: &[&str]) -> String { |
| 50 | let output = Command::new("git") |
| 51 | .args(args) |
| 52 | .current_dir(root) |
| 53 | .env("GIT_AUTHOR_NAME", "Branch Reconcile Tests") |
| 54 | .env("GIT_AUTHOR_EMAIL", "branch-reconcile@example.com") |
| 55 | .env("GIT_COMMITTER_NAME", "Branch Reconcile Tests") |
| 56 | .env("GIT_COMMITTER_EMAIL", "branch-reconcile@example.com") |
| 57 | .output() |
| 58 | .expect("run git"); |
| 59 | assert!( |
| 60 | output.status.success(), |
| 61 | "git {args:?} failed: {}", |
| 62 | String::from_utf8_lossy(&output.stderr) |
| 63 | ); |
| 64 | String::from_utf8(output.stdout) |
| 65 | .expect("utf8 git output") |
| 66 | .trim() |
| 67 | .to_string() |
| 68 | } |
| 69 | |
| 70 | /// A Git repository with one baseline commit, imported and shim-enabled. |
| 71 | fn shim_repo() -> (PathBuf, PathBuf) { |
no test coverage detected