MCPcopy Create free account
hub / github.com/HairlessVillager/minecommit / from_commit

Method from_commit

minecommit/src/odb/git.rs:29–43  ·  view source on GitHub ↗
(git_dir: PathBuf, commit: String)

Source from the content-addressed store, hash-verified

27 }
28
29 pub fn from_commit(git_dir: PathBuf, commit: String) -> Result<Self> {
30 let repo: gix::ThreadSafeRepository = gix::open(&git_dir)
31 .context("failed to open git repository")?
32 .into();
33 let path_to_oid = if commit.is_empty() {
34 HashMap::new()
35 } else {
36 build_path_to_oid(&git_dir, &commit)?
37 };
38 Ok(Self {
39 repo,
40 pending: HashMap::new(),
41 path_to_oid,
42 })
43 }
44
45 /// Create a commit from all pending blobs, consuming self.
46 ///

Callers

nothing calls this directly

Calls 1

build_path_to_oidFunction · 0.85

Tested by

no test coverage detected