| 2082 | } |
| 2083 | |
| 2084 | off_t find_pack_entry_one(const struct object_id *oid, |
| 2085 | struct packed_git *p) |
| 2086 | { |
| 2087 | const unsigned char *index = p->index_data; |
| 2088 | uint32_t result; |
| 2089 | |
| 2090 | if (!index) { |
| 2091 | if (open_pack_index(p)) |
| 2092 | return 0; |
| 2093 | } |
| 2094 | |
| 2095 | if (bsearch_pack(oid, p, &result)) |
| 2096 | return nth_packed_object_offset(p, result); |
| 2097 | return 0; |
| 2098 | } |
| 2099 | |
| 2100 | int is_pack_valid(struct packed_git *p) |
| 2101 | { |