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,
)
| 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 | } |