(root: &Path, args: &[&str])
| 179 | use tempfile::TempDir; |
| 180 | |
| 181 | fn git(root: &Path, args: &[&str]) { |
| 182 | let output = Command::new("git") |
| 183 | .args(args) |
| 184 | .current_dir(root) |
| 185 | .env("GIT_AUTHOR_NAME", "Linked Worktree Tests") |
| 186 | .env("GIT_AUTHOR_EMAIL", "linked@example.com") |
| 187 | .env("GIT_COMMITTER_NAME", "Linked Worktree Tests") |
| 188 | .env("GIT_COMMITTER_EMAIL", "linked@example.com") |
| 189 | .output() |
| 190 | .expect("run git"); |
| 191 | assert!( |
| 192 | output.status.success(), |
| 193 | "git {args:?} failed: {}", |
| 194 | String::from_utf8_lossy(&output.stderr) |
| 195 | ); |
| 196 | } |
| 197 | |
| 198 | /// A committed main worktree plus one linked worktree on its own branch. |
| 199 | fn repository_with_linked_worktree() -> (TempDir, TempDir) { |
no test coverage detected