Check if a file is tracked. # Arguments `path` - Path to check # Example ```rust,ignore if repo.is_tracked("src/main.rs")? { println!("File is tracked"); } ```
(&self, path: P)
| 703 | /// } |
| 704 | /// ``` |
| 705 | pub fn is_tracked<P: AsRef<Path>>(&self, path: P) -> Result<bool, RepositoryError> { |
| 706 | let normalized = normalize_path(path.as_ref()); |
| 707 | |
| 708 | let txn = self |
| 709 | .pristine |
| 710 | .read_txn() |
| 711 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 712 | |
| 713 | is_tracked(&txn, &normalized).map_err(|e| RepositoryError::Database(e.to_string())) |
| 714 | } |
| 715 | |
| 716 | /// Get the inode for a tracked file. |
| 717 | /// |