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

Function change_by_sha

atomic-cli/tests/it/git_import_cb9b_test.rs:185–204  ·  view source on GitHub ↗
(
    repo: &atomic_repository::Repository,
    view: &str,
    git_sha: &str,
)

Source from the content-addressed store, hash-verified

183
184#[allow(dead_code)]
185fn change_by_sha(
186 repo: &atomic_repository::Repository,
187 view: &str,
188 git_sha: &str,
189) -> atomic_core::change::Change {
190 let entries = repo.effective_history(Some(view)).unwrap();
191 for entry in entries {
192 let change = repo.load_change(&entry.hash).unwrap();
193 let sha = change
194 .unhashed
195 .as_ref()
196 .and_then(|value| value.get("git"))
197 .and_then(|git| git.get("sha"))
198 .and_then(|sha| sha.as_str());
199 if sha == Some(git_sha) {
200 return change;
201 }
202 }
203 panic!("no imported change for git commit {git_sha}")
204}
205
206fn frontier_closure_of(
207 repo: &atomic_repository::Repository,

Callers

nothing calls this directly

Calls 6

effective_historyMethod · 0.80
as_refMethod · 0.80
getMethod · 0.65
unwrapMethod · 0.45
load_changeMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected