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

Method record_introduced

atomic-cli/src/commands/git/parallel.rs:1034–1054  ·  view source on GitHub ↗

Record that importing `sha` introduced `hash` into `target_view`.

(&mut self, sha: &str, hash: ContentHash, target_view: &str)

Source from the content-addressed store, hash-verified

1032
1033 /// Record that importing `sha` introduced `hash` into `target_view`.
1034 fn record_introduced(&mut self, sha: &str, hash: ContentHash, target_view: &str) {
1035 self.introduced
1036 .insert(sha.to_string(), (hash, target_view.to_string()));
1037 // Refresh the memoized closure for `sha` (review R1): the persisted
1038 // row is closure(parent) ∪ {own hash}, so the in-run snapshot must
1039 // advance identically — later commits in this run then see exactly
1040 // what a later run reconstructs from the persisted rows.
1041 {
1042 let existing = self
1043 .closures
1044 .entry(sha.to_string())
1045 .or_insert_with(|| std::sync::Arc::new(HashSet::new()));
1046 let mut updated: HashSet<ContentHash> = (**existing).clone();
1047 updated.insert(hash);
1048 *existing = std::sync::Arc::new(updated);
1049 }
1050 // Keep the cached origin snapshot exact for the rest of this run.
1051 if let Some(members) = self.member_origins.as_mut() {
1052 members.push((hash, Some(sha.to_ascii_lowercase())));
1053 }
1054 }
1055}
1056
1057/// One evidence entry behind a reviewable RewriteCandidate link (CB-9B,

Callers 2

phase2_writeMethod · 0.80
write_commitMethod · 0.80

Calls 3

insertMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected