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

Function commit

atomic-cli/tests/it/git_import_path_audit_test.rs:30–46  ·  view source on GitHub ↗
(git: &GitRepository, files: &[(&str, &[u8], i32)], parents: &[Oid])

Source from the content-addressed store, hash-verified

28}
29
30fn commit(git: &GitRepository, files: &[(&str, &[u8], i32)], parents: &[Oid]) -> Oid {
31 let tree = git.find_tree(tree(git, files)).unwrap();
32 let parents: Vec<_> = parents
33 .iter()
34 .map(|id| git.find_commit(*id).unwrap())
35 .collect();
36 let signature = Signature::now("Import regression", "import@example.com").unwrap();
37 git.commit(
38 None,
39 &signature,
40 &signature,
41 "fixture",
42 &tree,
43 &parents.iter().collect::<Vec<_>>(),
44 )
45 .unwrap()
46}
47
48fn import(root: &Path, git: &GitRepository, tip: Oid, config: &Path) {
49 git.reference("refs/heads/main", tip, true, "fixture")

Calls 5

treeFunction · 0.70
unwrapMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected