| 1104 | } |
| 1105 | |
| 1106 | static int ext_index_add_object(struct bitmap_index *bitmap_git, |
| 1107 | struct object *object, const char *name) |
| 1108 | { |
| 1109 | struct eindex *eindex = &bitmap_git->ext_index; |
| 1110 | |
| 1111 | khiter_t hash_pos; |
| 1112 | int hash_ret; |
| 1113 | int bitmap_pos; |
| 1114 | |
| 1115 | hash_pos = kh_put_oid_pos(eindex->positions, object->oid, &hash_ret); |
| 1116 | if (hash_ret > 0) { |
| 1117 | if (eindex->count >= eindex->alloc) { |
| 1118 | eindex->alloc = (eindex->alloc + 16) * 3 / 2; |
| 1119 | REALLOC_ARRAY(eindex->objects, eindex->alloc); |
| 1120 | REALLOC_ARRAY(eindex->hashes, eindex->alloc); |
| 1121 | } |
| 1122 | |
| 1123 | bitmap_pos = eindex->count; |
| 1124 | eindex->objects[eindex->count] = object; |
| 1125 | eindex->hashes[eindex->count] = pack_name_hash(name); |
| 1126 | kh_value(eindex->positions, hash_pos) = bitmap_pos; |
| 1127 | eindex->count++; |
| 1128 | } else { |
| 1129 | bitmap_pos = kh_value(eindex->positions, hash_pos); |
| 1130 | } |
| 1131 | |
| 1132 | return bitmap_pos + bitmap_num_objects_total(bitmap_git); |
| 1133 | } |
| 1134 | |
| 1135 | struct bitmap_show_data { |
| 1136 | struct bitmap_index *bitmap_git; |
no test coverage detected