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,
working_copy: WorkingCopyId,
path: &str,
)
| 762 | /// Call this when a file is deleted (e.g., during git import cleanup) |
| 763 | /// so that `status` doesn't show it as a stale entry. |
| 764 | pub fn del_file_index( |
| 765 | &self, |
| 766 | working_copy: WorkingCopyId, |
| 767 | path: &str, |
| 768 | ) -> Result<(), RepositoryError> { |
| 769 | self.validate_working_copy(working_copy)?; |
| 770 | let mut txn = self |
| 771 | .pristine |
| 772 | .write_txn() |
| 773 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 774 | |
| 775 | let normalized = path.replace('\\', "/"); |
| 776 | txn.del_working_copy_file_index(working_copy, &normalized) |
| 777 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 778 | |
| 779 | txn.commit() |
| 780 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 781 | |
| 782 | Ok(()) |
| 783 | } |
| 784 | |
| 785 | /// Remove multiple files from the FILE_INDEX in a single write transaction. |
| 786 | /// |
no test coverage detected