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

Function commit

atomic-cli/tests/it/git_import_tracked_vault_regression.rs:93–114  ·  view source on GitHub ↗
(
    git: &GitRepository,
    files: &[(&str, &str)],
    message: &str,
    parent: Option<git2::Oid>,
)

Source from the content-addressed store, hash-verified

91}
92
93fn commit(
94 git: &GitRepository,
95 files: &[(&str, &str)],
96 message: &str,
97 parent: Option<git2::Oid>,
98) -> git2::Oid {
99 let tree = git.find_tree(write_tree(git, files)).unwrap();
100 let signature = Signature::now("Vault Fixture", "vault@example.com").unwrap();
101 let parents: Vec<_> = parent
102 .map(|oid| git.find_commit(oid).unwrap())
103 .into_iter()
104 .collect();
105 git.commit(
106 Some("refs/heads/main"),
107 &signature,
108 &signature,
109 message,
110 &tree,
111 &parents.iter().collect::<Vec<_>>(),
112 )
113 .unwrap()
114}
115
116/// Build a two-commit repository; `with_vault` controls whether the history
117/// tracks custom `.vault/` content, and return its root and isolated HOME.

Callers 1

fixtureFunction · 0.70

Calls 6

write_treeFunction · 0.70
unwrapMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45
commitMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected