MCPcopy Create free account
hub / github.com/git/git / commit_tree_with_edited_message

Function commit_tree_with_edited_message

builtin/history.c:160–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160static int commit_tree_with_edited_message(struct repository *repo,
161 const char *action,
162 struct commit *original,
163 struct commit **out)
164{
165 struct object_id parent_tree_oid;
166 const struct object_id *tree_oid;
167 struct commit *parent;
168
169 tree_oid = &repo_get_commit_tree(repo, original)->object.oid;
170
171 parent = original->parents ? original->parents->item : NULL;
172 if (parent) {
173 if (repo_parse_commit(repo, parent)) {
174 return error(_("unable to parse parent commit %s"),
175 oid_to_hex(&parent->object.oid));
176 }
177
178 parent_tree_oid = repo_get_commit_tree(repo, parent)->object.oid;
179 } else {
180 oidcpy(&parent_tree_oid, repo->hash_algo->empty_tree);
181 }
182
183 return commit_tree_ext(repo, action, original, original->parents,
184 &parent_tree_oid, tree_oid, out, COMMIT_TREE_EDIT_MESSAGE);
185}
186
187enum ref_action {
188 REF_ACTION_DEFAULT,

Callers 1

cmd_history_rewordFunction · 0.85

Calls 6

repo_get_commit_treeFunction · 0.85
repo_parse_commitFunction · 0.85
errorFunction · 0.85
oid_to_hexFunction · 0.85
oidcpyFunction · 0.85
commit_tree_extFunction · 0.85

Tested by

no test coverage detected