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

Method tracked_files_under

atomic-repository/src/repository/tracking.rs:935–948  ·  view source on GitHub ↗

List tracked files under a given path prefix. Get all tracked files under a directory prefix. # Arguments `prefix` - Directory prefix to search under # Example ```rust,ignore let src_files = repo.tracked_files_under("src")?; println!("Files in src/: {}", src_files.len()); ```

(
        &self,
        prefix: P,
    )

Source from the content-addressed store, hash-verified

933 /// println!("Files in src/: {}", src_files.len());
934 /// ```
935 pub fn tracked_files_under<P: AsRef<Path>>(
936 &self,
937 prefix: P,
938 ) -> Result<Vec<(String, Inode)>, RepositoryError> {
939 let normalized = normalize_path(prefix.as_ref());
940
941 let txn = self
942 .pristine
943 .read_txn()
944 .map_err(|e| RepositoryError::Database(e.to_string()))?;
945
946 tracked_under_prefix(&txn, &normalized)
947 .map_err(|e| RepositoryError::Database(e.to_string()))
948 }
949}
950
951#[cfg(test)]

Callers 1

Calls 4

tracked_under_prefixFunction · 0.85
as_refMethod · 0.80
read_txnMethod · 0.80
normalize_pathFunction · 0.50

Tested by 1