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

Function commit_graph_data_at

commit-graph.c:147–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static struct commit_graph_data *commit_graph_data_at(const struct commit *c)
148{
149 unsigned int i, nth_slab;
150 struct commit_graph_data *data =
151 commit_graph_data_slab_peek(&commit_graph_data_slab, c);
152
153 if (data)
154 return data;
155
156 nth_slab = c->index / commit_graph_data_slab.slab_size;
157 data = commit_graph_data_slab_at(&commit_graph_data_slab, c);
158
159 /*
160 * commit-slab initializes elements with zero, overwrite this with
161 * COMMIT_NOT_FROM_GRAPH for graph_pos.
162 *
163 * We avoid initializing generation with checking if graph position
164 * is not COMMIT_NOT_FROM_GRAPH.
165 */
166 for (i = 0; i < commit_graph_data_slab.slab_size; i++) {
167 commit_graph_data_slab.slab[nth_slab][i].graph_pos =
168 COMMIT_NOT_FROM_GRAPH;
169 }
170
171 return data;
172}
173
174/*
175 * Should be used only while writing commit-graph as it compares

Callers 8

commit_gen_cmpFunction · 0.85
insert_parent_or_dieFunction · 0.85
fill_commit_graph_infoFunction · 0.85
set_generation_v2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected