diff options
| -rw-r--r-- | packfile.c | 28 | ||||
| -rw-r--r-- | packfile.h | 6 |
2 files changed, 10 insertions, 24 deletions
diff --git a/packfile.c b/packfile.c index 23d8f7cb93..3bce1b150d 100644 --- a/packfile.c +++ b/packfile.c @@ -2215,12 +2215,17 @@ struct packed_git **packfile_store_get_kept_pack_cache(struct packfile_store *st return store->kept_cache.packs; } -int find_kept_pack_entry(struct repository *r, - const struct object_id *oid, - unsigned flags, - struct pack_entry *e) +int has_object_pack(struct repository *r, const struct object_id *oid) +{ + struct pack_entry e; + return find_pack_entry(r, oid, &e); +} + +int has_object_kept_pack(struct repository *r, const struct object_id *oid, + unsigned flags) { struct odb_source *source; + struct pack_entry e; for (source = r->objects->sources; source; source = source->next) { struct packed_git **cache; @@ -2229,7 +2234,7 @@ int find_kept_pack_entry(struct repository *r, for (; *cache; cache++) { struct packed_git *p = *cache; - if (fill_pack_entry(oid, e, p)) + if (fill_pack_entry(oid, &e, p)) return 1; } } @@ -2237,19 +2242,6 @@ int find_kept_pack_entry(struct repository *r, return 0; } -int has_object_pack(struct repository *r, const struct object_id *oid) -{ - struct pack_entry e; - return find_pack_entry(r, oid, &e); -} - -int has_object_kept_pack(struct repository *r, const struct object_id *oid, - unsigned flags) -{ - struct pack_entry e; - return find_kept_pack_entry(r, oid, flags, &e); -} - int for_each_object_in_pack(struct packed_git *p, each_packed_object_fn cb, void *data, enum for_each_object_flags flags) diff --git a/packfile.h b/packfile.h index 07f7cdbad1..08a666d538 100644 --- a/packfile.h +++ b/packfile.h @@ -445,12 +445,6 @@ int packed_object_info(struct repository *r, void mark_bad_packed_object(struct packed_git *, const struct object_id *); const struct packed_git *has_packed_and_bad(struct repository *, const struct object_id *); -/* - * Iff a pack file in the given repository contains the object named by sha1, - * return true and store its location to e. - */ -int find_kept_pack_entry(struct repository *r, const struct object_id *oid, unsigned flags, struct pack_entry *e); - int has_object_pack(struct repository *r, const struct object_id *oid); int has_object_kept_pack(struct repository *r, const struct object_id *oid, unsigned flags); |
