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

Method tracked_files_under

atomic-repository/src/repository/tracking.rs:679–692  ·  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

677 /// println!("Files in src/: {}", src_files.len());
678 /// ```
679 pub fn tracked_files_under<P: AsRef<Path>>(
680 &self,
681 prefix: P,
682 ) -> Result<Vec<(String, Inode)>, RepositoryError> {
683 let normalized = normalize_path(prefix.as_ref());
684
685 let txn = self
686 .pristine
687 .read_txn()
688 .map_err(|e| RepositoryError::Database(e.to_string()))?;
689
690 tracked_under_prefix(&txn, &normalized)
691 .map_err(|e| RepositoryError::Database(e.to_string()))
692 }
693}

Callers 1

Calls 4

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

Tested by 1