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

Function list_tracked

atomic-repository/src/tracking/tree_ops.rs:324–337  ·  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

322///
323/// A vector of all tracked files and directories.
324pub fn list_tracked<T: TreeTxnT>(txn: &T) -> TrackingResult<Vec<TrackedFile>> {
325 let iter = txn
326 .iter_tree()
327 .map_err(|e| TrackingError::Database(e.to_string()))?;
328
329 let mut results = Vec::new();
330 for result in iter {
331 let (path, inode) = result.map_err(|e| TrackingError::Database(e.to_string()))?;
332 let is_directory = is_directory_inode(txn, inode)?;
333 results.push(TrackedFile::new(PathBuf::from(path), inode, is_directory));
334 }
335
336 Ok(results)
337}
338
339/// List all tracked directories.
340///

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