if (xor_offset > 0) {
xor_bitmap = recent_bitmaps[(i - xor_offset) % MAX_XOR_OFFSET];
- if (xor_bitmap == NULL)
+ if (!xor_bitmap)
- return error("Invalid XOR offset in bitmap pack index");
+ return error(_("invalid XOR offset in bitmap pack index"));
}
recent_bitmaps[i % MAX_XOR_OFFSET] = store_bitmap(
struct multi_pack_index *midx)
{
struct stat st;
- char *idx_name = midx_bitmap_filename(midx);
- int fd = git_open(idx_name);
+ char *bitmap_name = midx_bitmap_filename(midx);
+ int fd = git_open(bitmap_name);
+ uint32_t i;
+ struct packed_git *preferred;
- free(idx_name);
-
- if (fd < 0)
+ if (fd < 0) {
+ if (errno != ENOENT)
+ warning_errno("cannot open '%s'", bitmap_name);
+ free(bitmap_name);
return -1;
+ }
+ free(bitmap_name);
if (fstat(fd, &st)) {
+ error_errno(_("cannot fstat bitmap file"));
close(fd);
return -1;
}
result = ewah_to_bitmap(bm);
}
- if (result == NULL)
+ if (!result)
- die("Commit %s doesn't have an indexed bitmap", oid_to_hex(&root->oid));
+ die(_("commit '%s' doesn't have an indexed bitmap"), oid_to_hex(&root->oid));
revs->tag_objects = 1;
revs->tree_objects = 1;