MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / del_file_index

Method del_file_index

atomic-repository/src/repository/tracking.rs:764–783  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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 ///

Callers 3

unrecordMethod · 0.45
retain_view_changesMethod · 0.45

Calls 5

validate_working_copyMethod · 0.80
write_txnMethod · 0.80
replaceMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected