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

Function tracked_path_state

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

Classify a tracked inode by the state that tracking itself owns for it. `add` creates a staged binding (`TREE`/`REV_TREE` only). `record` additionally binds the inode to its graph position (`INODES`/`REV_INODES`) and appends the `PATH_CLAIMS` events that make the name durable. A bound inode is therefore change-derived: rebuilding it belongs to `atomic doctor repair-native-indexes`, and a tracking

(txn: &T, inode: Inode)

Source from the content-addressed store, hash-verified

755/// change-derived: rebuilding it belongs to `atomic doctor repair-native-indexes`,
756/// and a tracking edit cannot durably undo it. See [`TrackedPathState`].
757pub fn tracked_path_state<T: TreeTxnT>(txn: &T, inode: Inode) -> TrackingResult<TrackedPathState> {
758 let position = txn
759 .inode_position(inode)
760 .map_err(|e| TrackingError::Database(e.to_string()))?;
761 Ok(if position.is_some() {
762 TrackedPathState::Recorded
763 } else {
764 TrackedPathState::Staged
765 })
766}
767
768/// Remove a *staged* path from tracking: the inverse of `add_to_tree`.
769///

Callers 4

removal_candidatesFunction · 0.85
remove_batchMethod · 0.85
untrack_staged_pathFunction · 0.85

Calls 1

inode_positionMethod · 0.45

Tested by

no test coverage detected