return 1;
}
-static int find_pack_entry(struct repository *r,
+static int find_pack_entry(struct packfile_store *store,
const struct object_id *oid,
struct pack_entry *e)
{
- struct odb_source *source;
-
- for (source = r->objects->sources; source; source = source->next) {
- packfile_store_prepare(r->objects->sources->packfiles);
- if (source->midx && fill_midx_entry(source->midx, oid, e))
- return 1;
- }
+ struct packfile_list_entry *l;
- for (source = r->objects->sources; source; source = source->next) {
- struct packfile_list_entry *l;
+ packfile_store_prepare(store);
+ if (store->source->midx && fill_midx_entry(store->source->midx, oid, e))
+ return 1;
- for (l = source->packfiles->packs.head; l; l = l->next) {
- struct packed_git *p = l->pack;
+ for (l = store->packs.head; l; l = l->next) {
+ struct packed_git *p = l->pack;
- if (!p->multi_pack_index && fill_pack_entry(oid, e, p)) {
- if (!source->packfiles->skip_mru_updates)
- packfile_list_prepend(&source->packfiles->packs, p);
- return 1;
- }
+ if (!p->multi_pack_index && fill_pack_entry(oid, e, p)) {
+ if (!store->skip_mru_updates)
+ packfile_list_prepend(&store->packs, p);
+ return 1;
}
}
const struct object_id *oid)
{
struct pack_entry e;
- if (!find_pack_entry(store->source->odb->repo, oid, &e))
+ if (!find_pack_entry(store, oid, &e))
return 0;
if (e.p->is_cruft)
return 0;
struct pack_entry e;
int rtype;
- if (!find_pack_entry(store->source->odb->repo, oid, &e))
+ if (!find_pack_entry(store, oid, &e))
return 1;
/*
int has_object_pack(struct repository *r, const struct object_id *oid)
{
+ struct odb_source *source;
struct pack_entry e;
- return find_pack_entry(r, oid, &e);
+
+ odb_prepare_alternates(r->objects);
+ for (source = r->objects->sources; source; source = source->next) {
+ int ret = find_pack_entry(source->packfiles, oid, &e);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
int has_object_kept_pack(struct repository *r, const struct object_id *oid,