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

Function collect_tracked_paths

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

Source from the content-addressed store, hash-verified

358}
359
360fn collect_tracked_paths(
361 root: &Path,
362 parent_oid: Option<&str>,
363) -> Result<BTreeSet<Vec<u8>>, WipCaptureError> {
364 let mut paths = split_nul(git_bytes(
365 root,
366 "list live-index paths",
367 &os_args(&["ls-files", "--cached", "-z"]),
368 None,
369 None,
370 )?)
371 .into_iter()
372 .collect::<BTreeSet<_>>();
373
374 if let Some(parent_oid) = parent_oid {
375 let args = vec![
376 OsString::from("ls-tree"),
377 OsString::from("-r"),
378 OsString::from("-z"),
379 OsString::from("--name-only"),
380 OsString::from(parent_oid),
381 ];
382 paths.extend(split_nul(git_bytes(
383 root,
384 "list HEAD paths",
385 &args,
386 None,
387 None,
388 )?));
389 }
390
391 Ok(paths)
392}
393
394fn initialize_alternate_index(
395 root: &Path,

Callers 1

prepare_tracked_wipFunction · 0.85

Calls 5

split_nulFunction · 0.85
git_bytesFunction · 0.85
os_argsFunction · 0.85
extendMethod · 0.80
into_iterMethod · 0.45

Tested by

no test coverage detected