static struct stored_bitmap *store_bitmap(struct bitmap_index *index,
struct ewah_bitmap *root,
- const unsigned char *hash,
+ const struct object_id *oid,
struct stored_bitmap *xor_with,
int flags)
{
stored->root = root;
stored->xor = xor_with;
stored->flags = flags;
- oidread(&stored->oid, hash);
+ oidcpy(&stored->oid, oid);
hash_pos = kh_put_oid_map(index->bitmaps, stored->oid, &ret);
* because the SHA1 already existed on the map. this is bad, there
* shouldn't be duplicated commits in the index */
if (ret == 0) {
- error("Duplicate entry in bitmap index: %s", hash_to_hex(hash));
+ error("Duplicate entry in bitmap index: %s", oid_to_hex(oid));
return NULL;
}
struct ewah_bitmap *bitmap = NULL;
struct stored_bitmap *xor_bitmap = NULL;
uint32_t commit_idx_pos;
- const unsigned char *sha1;
+ struct object_id oid;
commit_idx_pos = read_be32(index->map, &index->map_pos);
xor_offset = read_u8(index->map, &index->map_pos);
flags = read_u8(index->map, &index->map_pos);
- sha1 = nth_packed_object_sha1(index->pack, commit_idx_pos);
+ nth_packed_object_id(&oid, index->pack, commit_idx_pos);
bitmap = read_bitmap_1(index);
if (!bitmap)
}
recent_bitmaps[i % MAX_XOR_OFFSET] = store_bitmap(
- index, bitmap, sha1, xor_bitmap, flags);
+ index, bitmap, &oid, xor_bitmap, flags);
}
return 0;