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

Function load_oid_from_graph

commit-graph.c:840–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840static void load_oid_from_graph(struct commit_graph *g,
841 uint32_t pos,
842 struct object_id *oid)
843{
844 uint32_t lex_index;
845
846 while (g && pos < g->num_commits_in_base)
847 g = g->base_graph;
848
849 if (!g)
850 BUG("NULL commit-graph");
851
852 if (pos >= g->num_commits + g->num_commits_in_base)
853 die(_("invalid commit position. commit-graph is likely corrupt"));
854
855 lex_index = pos - g->num_commits_in_base;
856
857 oidread(oid, g->chunk_oid_lookup + st_mult(g->hash_algo->rawsz, lex_index),
858 g->hash_algo);
859}
860
861static struct commit_list **insert_parent_or_die(struct commit_graph *g,
862 uint32_t pos,

Callers 2

insert_parent_or_dieFunction · 0.85
merge_commit_graphFunction · 0.85

Calls 3

oidreadFunction · 0.85
st_multFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected