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

Function remove_from_tree

atomic-repository/src/tracking/tree_ops.rs:208–222  ·  view source on GitHub ↗

Remove a single file from tracking. This is the low-level function that actually modifies the database. # Arguments `txn` - A mutable transaction `path` - The normalized path string # Returns The inode that was removed, if any.

(txn: &mut T, path: &str)

Source from the content-addressed store, hash-verified

206///
207/// The inode that was removed, if any.
208pub fn remove_from_tree<T: MutTxnT>(txn: &mut T, path: &str) -> TrackingResult<Option<Inode>> {
209 // Remove from tree (this also removes from REV_TREE)
210 let inode = txn
211 .del_tree(path)
212 .map_err(|e| TrackingError::Database(e.to_string()))?;
213
214 // If there was an inode, also remove its position mapping and directory marker
215 if let Some(inode) = inode {
216 let _ = txn.del_inode(inode);
217 // Remove directory marker if present
218 let _ = txn.del_directory(inode);
219 }
220
221 Ok(inode)
222}
223
224/// Remove a directory from tracking.
225///

Callers 3

remove_batchMethod · 0.85
removeMethod · 0.85

Calls 3

del_treeMethod · 0.80
del_inodeMethod · 0.80
del_directoryMethod · 0.80

Tested by 1