Remove a file from the FILE_INDEX. Call this when a file is deleted (e.g., during git import cleanup) so that `status` doesn't show it as a stale entry.
(&self, path: &str)
| 524 | /// Call this when a file is deleted (e.g., during git import cleanup) |
| 525 | /// so that `status` doesn't show it as a stale entry. |
| 526 | pub fn del_file_index(&self, path: &str) -> Result<(), RepositoryError> { |
| 527 | let mut txn = self |
| 528 | .pristine |
| 529 | .write_txn() |
| 530 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 531 | |
| 532 | let normalized = path.replace('\\', "/"); |
| 533 | txn.del_file_index(&normalized) |
| 534 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 535 | |
| 536 | txn.commit() |
| 537 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 538 | |
| 539 | Ok(()) |
| 540 | } |
| 541 | |
| 542 | /// Remove multiple files from the FILE_INDEX in a single write transaction. |
| 543 | /// |