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)
| 465 | /// } |
| 466 | /// ``` |
| 467 | pub fn is_tracked<P: AsRef<Path>>(&self, path: P) -> Result<bool, RepositoryError> { |
| 468 | let normalized = normalize_path(path.as_ref()); |
| 469 | |
| 470 | let txn = self |
| 471 | .pristine |
| 472 | .read_txn() |
| 473 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 474 | |
| 475 | is_tracked(&txn, &normalized).map_err(|e| RepositoryError::Database(e.to_string())) |
| 476 | } |
| 477 | |
| 478 | /// Get the inode for a tracked file. |
| 479 | /// |