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

Function load_tree_for_commit

commit-graph.c:1094–1112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094static struct tree *load_tree_for_commit(struct commit_graph *g,
1095 struct commit *c)
1096{
1097 struct object_id oid;
1098 const unsigned char *commit_data;
1099 uint32_t graph_pos = commit_graph_position(c);
1100
1101 while (graph_pos < g->num_commits_in_base)
1102 g = g->base_graph;
1103
1104 commit_data = g->chunk_commit_data +
1105 st_mult(graph_data_width(g->hash_algo),
1106 graph_pos - g->num_commits_in_base);
1107
1108 oidread(&oid, commit_data, g->hash_algo);
1109 set_commit_tree(c, lookup_tree(g->odb_source->odb->repo, &oid));
1110
1111 return c->maybe_tree;
1112}
1113
1114static struct tree *get_commit_tree_in_graph_one(struct commit_graph *g,
1115 const struct commit *c)

Callers 1

Calls 6

commit_graph_positionFunction · 0.85
st_multFunction · 0.85
graph_data_widthFunction · 0.85
oidreadFunction · 0.85
lookup_treeFunction · 0.85
set_commit_treeFunction · 0.70

Tested by

no test coverage detected