MCPcopy Index your code
hub / github.com/git/git / repo_get_commit_tree

Function repo_get_commit_tree

commit.c:458–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458struct tree *repo_get_commit_tree(struct repository *r,
459 const struct commit *commit)
460{
461 if (commit->maybe_tree || !commit->object.parsed)
462 return commit->maybe_tree;
463
464 if (commit_graph_position(commit) != COMMIT_NOT_FROM_GRAPH)
465 return get_commit_tree_in_graph(r, commit);
466
467 /*
468 * This is either a corrupt commit, or one which we partially loaded
469 * from a graph file but then subsequently threw away the graph data.
470 *
471 * Optimistically assume it's the latter and try to reload from
472 * scratch. This gives a performance penalty if it really is a corrupt
473 * commit, but presumably that happens rarely (and only once per
474 * process).
475 */
476 load_tree_from_commit_contents(r, (struct commit *)commit);
477 return commit->maybe_tree;
478}
479
480struct object_id *get_commit_tree_oid(const struct commit *commit)
481{

Callers 15

merge_ort_internalFunction · 0.85
merge_ort_recursiveFunction · 0.85
get_deltaFunction · 0.85
rev_compare_treeFunction · 0.85
rev_same_tree_as_emptyFunction · 0.85
try_to_simplify_commitFunction · 0.85
do_recursive_mergeFunction · 0.85
add_edge_parentsFunction · 0.85
mark_edges_uninterestingFunction · 0.85
do_traverseFunction · 0.85
fsck_walk_commitFunction · 0.85

Calls 3

commit_graph_positionFunction · 0.85
get_commit_tree_in_graphFunction · 0.85

Tested by

no test coverage detected