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

Function list_tracked

atomic-repository/src/tracking/tree_ops.rs:937–950  ·  view source on GitHub ↗

List all tracked files. # Arguments `txn` - A transaction (read or write) # Returns A vector of all tracked files and directories.

(txn: &T)

Source from the content-addressed store, hash-verified

935///
936/// A vector of all tracked files and directories.
937pub fn list_tracked<T: TreeTxnT>(txn: &T) -> TrackingResult<Vec<TrackedFile>> {
938 let iter = txn
939 .iter_tree()
940 .map_err(|e| TrackingError::Database(e.to_string()))?;
941
942 let mut results = Vec::new();
943 for result in iter {
944 let (path, inode) = result.map_err(|e| TrackingError::Database(e.to_string()))?;
945 let is_directory = is_directory_inode(txn, inode)?;
946 results.push(TrackedFile::new(PathBuf::from(path), inode, is_directory));
947 }
948
949 Ok(results)
950}
951
952/// List all tracked directories.
953///

Callers 5

list_tracked_filesMethod · 0.85
archiveMethod · 0.85
test_list_tracked_filesFunction · 0.85
list_tracked_directoriesFunction · 0.85

Calls 3

is_directory_inodeFunction · 0.85
iter_treeMethod · 0.45
pushMethod · 0.45

Tested by 1

test_list_tracked_filesFunction · 0.68