(root: &Path)
| 325 | } |
| 326 | |
| 327 | fn require_worktree(root: &Path) -> Result<(), WipCaptureError> { |
| 328 | let inside = git_text( |
| 329 | root, |
| 330 | "identify Git working tree", |
| 331 | &os_args(&["rev-parse", "--is-inside-work-tree"]), |
| 332 | None, |
| 333 | None, |
| 334 | )?; |
| 335 | if inside != "true" { |
| 336 | return Err(WipCaptureError::NotAWorkingTree { |
| 337 | path: root.to_path_buf(), |
| 338 | }); |
| 339 | } |
| 340 | Ok(()) |
| 341 | } |
| 342 | |
| 343 | fn resolve_head(root: &Path) -> Result<Option<String>, WipCaptureError> { |
| 344 | let output = run_git_raw( |
no test coverage detected