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

Function load_commit_graph_one_fd_st

commit-graph.c:256–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256struct commit_graph *load_commit_graph_one_fd_st(struct odb_source *source,
257 int fd, struct stat *st)
258{
259 void *graph_map;
260 size_t graph_size;
261 struct commit_graph *ret;
262
263 graph_size = xsize_t(st->st_size);
264
265 if (graph_size < graph_min_size(source->odb->repo->hash_algo)) {
266 close(fd);
267 error(_("commit-graph file is too small"));
268 return NULL;
269 }
270 graph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);
271 close(fd);
272
273 ret = parse_commit_graph(source->odb->repo, graph_map, graph_size);
274 if (ret)
275 ret->odb_source = source;
276 else
277 munmap(graph_map, graph_size);
278
279 return ret;
280}
281
282static int graph_read_oid_fanout(const unsigned char *chunk_start,
283 size_t chunk_size, void *data)

Callers 2

load_commit_graph_oneFunction · 0.85
graph_verifyFunction · 0.85

Calls 5

xsize_tFunction · 0.85
graph_min_sizeFunction · 0.85
errorFunction · 0.85
xmmapFunction · 0.85
parse_commit_graphFunction · 0.85

Tested by

no test coverage detected