(
root: &Path,
parent_oid: Option<&str>,
tree_oid: &str,
)
| 436 | } |
| 437 | |
| 438 | fn changed_paths( |
| 439 | root: &Path, |
| 440 | parent_oid: Option<&str>, |
| 441 | tree_oid: &str, |
| 442 | ) -> Result<Vec<Vec<u8>>, WipCaptureError> { |
| 443 | let bytes = if let Some(parent_oid) = parent_oid { |
| 444 | let args = vec![ |
| 445 | OsString::from("diff-tree"), |
| 446 | OsString::from("--no-commit-id"), |
| 447 | OsString::from("--name-only"), |
| 448 | OsString::from("-r"), |
| 449 | OsString::from("-z"), |
| 450 | OsString::from(parent_oid), |
| 451 | OsString::from(tree_oid), |
| 452 | ]; |
| 453 | git_bytes(root, "list WIP paths", &args, None, None)? |
| 454 | } else { |
| 455 | let args = vec![ |
| 456 | OsString::from("ls-tree"), |
| 457 | OsString::from("-r"), |
| 458 | OsString::from("-z"), |
| 459 | OsString::from("--name-only"), |
| 460 | OsString::from(tree_oid), |
| 461 | ]; |
| 462 | git_bytes(root, "list unborn WIP paths", &args, None, None)? |
| 463 | }; |
| 464 | Ok(split_nul(bytes)) |
| 465 | } |
| 466 | |
| 467 | fn ensure_head_unchanged(root: &Path, before: &Option<String>) -> Result<(), WipCaptureError> { |
| 468 | let after = resolve_head(root)?; |
no test coverage detected