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

Method raw_git_sha_row

atomic-repository/src/repository/resurrection.rs:651–668  ·  view source on GitHub ↗

The raw `GIT_SHA_INDEX` row for one SHA: the mapped change must be registered, loadable, and decode to exactly its claimed identity. Used only to *shortlist* binding candidates — never as identity.

(&self, sha: &str)

Source from the content-addressed store, hash-verified

649 /// registered, loadable, and decode to exactly its claimed identity.
650 /// Used only to *shortlist* binding candidates — never as identity.
651 fn raw_git_sha_row(&self, sha: &str) -> Result<Option<Hash>, RepositoryError> {
652 use atomic_core::pristine::{GitShaIndexTxnT, GraphTxnT};
653 let txn = self.pristine.read_txn().map_err(pristine_map)?;
654 let Some(change_id) = txn.get_by_git_sha(sha).map_err(pristine_map)? else {
655 return Ok(None);
656 };
657 let Some(hash) = txn.get_external(change_id).map_err(pristine_map)? else {
658 return Ok(None);
659 };
660 drop(txn);
661 if !self.has_change(&hash) {
662 return Ok(None);
663 }
664 match self.load_change(&hash) {
665 Ok(_) => Ok(Some(hash)),
666 Err(_) => Ok(None),
667 }
668 }
669
670 /// The checked import skip markers over the whole `GIT_SHA_INDEX`.
671 ///

Callers 1

resolve_git_shaMethod · 0.80

Calls 5

read_txnMethod · 0.80
get_by_git_shaMethod · 0.45
get_externalMethod · 0.45
has_changeMethod · 0.45
load_changeMethod · 0.45

Tested by

no test coverage detected