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

Function trunk_facts_on

atomic-cli/tests/it/git_import_cb9c_test.rs:1384–1396  ·  view source on GitHub ↗

Trunk row facts using an EXISTING Repository handle (no re-open, so it is safe while the caller holds the database).

(
    repo: &atomic_repository::Repository,
    path: &str,
)

Source from the content-addressed store, hash-verified

1382/// Trunk row facts using an EXISTING Repository handle (no re-open, so it is
1383/// safe while the caller holds the database).
1384fn trunk_facts_on(
1385 repo: &atomic_repository::Repository,
1386 path: &str,
1387) -> Option<(TrunkId, String, bool)> {
1388 use atomic_core::crdt::tables::{decode_trunk_id, encode_trunk_id};
1389 let txn = repo.pristine().read_txn().unwrap();
1390 let trunk = CrdtTxnT::get_trunk_by_path(&txn, path).unwrap();
1391 trunk.map(|trunk| {
1392 let key = encode_trunk_id(&trunk);
1393 let row = CrdtTxnT::get_crdt_trunk(&txn, &key).unwrap().unwrap();
1394 (decode_trunk_id(&key), row.path, row.state.is_alive())
1395 })
1396}
1397
1398/// Review CB-9C R2 (re-review EYL): a unique pure rename must route through
1399/// the native move pipeline so the semantic layer learns the move. After a

Calls 6

encode_trunk_idFunction · 0.85
decode_trunk_idFunction · 0.85
read_txnMethod · 0.80
pristineMethod · 0.80
unwrapMethod · 0.45
is_aliveMethod · 0.45

Tested by

no test coverage detected