return 0;
}
-int matches_pack_name(struct packed_git *p, const char *name)
-{
- const char *last_c, *c;
-
- if (!strcmp(p->pack_name, name))
- return 1;
-
- for (c = p->pack_name, last_c = c; *c;)
- if (*c == '/')
- last_c = ++c;
- else
- ++c;
- if (!strcmp(last_c, name))
- return 1;
-
- return 0;
-}
-
-static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
+static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
{
static struct packed_git *last_found = (void *)1;
struct packed_git *p;
p = (last_found == (void *)1) ? packed_git : last_found;
do {
- if (ignore_packed) {
- const char **ig;
- for (ig = ignore_packed; *ig; ig++)
- if (matches_pack_name(p, *ig))
- break;
- if (*ig)
- goto next;
- }
-
if (p->num_bad_objects) {
unsigned i;
for (i = 0; i < p->num_bad_objects; i++)
return 0;
}
-static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
-{
- return find_pack_ent(sha1, e, NULL);
-}
-
-static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
-{
- return find_pack_ent(sha1, e, ignore_packed);
-}
-
struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs)
{
return find_pack_entry(sha1, &e);
}
-int has_sha1_kept_pack(const unsigned char *sha1, const char **ignore_packed)
-{
- struct pack_entry e;
- return find_kept_pack_entry(sha1, &e, ignore_packed);
-}
-
int has_sha1_file(const unsigned char *sha1)
{
struct pack_entry e;