MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / changed_paths

Function changed_paths

atomic-repository/src/wip.rs:438–465  ·  view source on GitHub ↗
(
    root: &Path,
    parent_oid: Option<&str>,
    tree_oid: &str,
)

Source from the content-addressed store, hash-verified

436}
437
438fn 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
467fn ensure_head_unchanged(root: &Path, before: &Option<String>) -> Result<(), WipCaptureError> {
468 let after = resolve_head(root)?;

Callers 1

prepare_tracked_wipFunction · 0.85

Calls 2

git_bytesFunction · 0.85
split_nulFunction · 0.85

Tested by

no test coverage detected