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

Function parent_commit

atomic-repository/src/repository/projection_commit.rs:700–709  ·  view source on GitHub ↗
(git: &git2::Repository, tree: &GitObjectId)

Source from the content-addressed store, hash-verified

698 }
699
700 fn parent_commit(git: &git2::Repository, tree: &GitObjectId) -> GitObjectId {
701 let tree = git
702 .find_tree(to_git2_oid(tree).unwrap())
703 .expect("parent tree");
704 let signature = git2::Signature::now("seed", "seed@example.com").unwrap();
705 let oid = git
706 .commit(None, &signature, &signature, "seed", &tree, &[])
707 .expect("seed commit");
708 GitObjectId::new(GitHashAlgorithm::Sha1, oid.as_bytes().to_vec()).unwrap()
709 }
710
711 fn author() -> ProjectionAuthor {
712 ProjectionAuthor {

Calls 4

to_git2_oidFunction · 0.70
unwrapMethod · 0.45
commitMethod · 0.45
as_bytesMethod · 0.45