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

Function write_graph_chunk_fanout

commit-graph.c:1172–1197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1170};
1171
1172static int write_graph_chunk_fanout(struct hashfile *f,
1173 void *data)
1174{
1175 struct write_commit_graph_context *ctx = data;
1176 int i, count = 0;
1177 struct commit **list = ctx->commits.items;
1178
1179 /*
1180 * Write the first-level table (the list is sorted,
1181 * but we use a 256-entry lookup to be able to avoid
1182 * having to do eight extra binary search iterations).
1183 */
1184 for (i = 0; i < 256; i++) {
1185 while (count < ctx->commits.nr) {
1186 if ((*list)->object.oid.hash[0] != i)
1187 break;
1188 display_progress(ctx->progress, ++ctx->progress_cnt);
1189 count++;
1190 list++;
1191 }
1192
1193 hashwrite_be32(f, count);
1194 }
1195
1196 return 0;
1197}
1198
1199static int write_graph_chunk_oids(struct hashfile *f,
1200 void *data)

Callers

nothing calls this directly

Calls 2

display_progressFunction · 0.85
hashwrite_be32Function · 0.85

Tested by

no test coverage detected