| 838 | } |
| 839 | |
| 840 | static 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 | |
| 861 | static struct commit_list **insert_parent_or_die(struct commit_graph *g, |
| 862 | uint32_t pos, |
no test coverage detected