packfile: convert has_packed_and_bad() to object_id

The single caller has a full object ID, so pass it on instead of just
its hash member.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2021-09-11 22:42:20 +02:00
committed by Junio C Hamano
parent 751530de5d
commit 7407d733a4
3 changed files with 4 additions and 4 deletions

View File

@ -1176,14 +1176,14 @@ void mark_bad_packed_object(struct packed_git *p, const struct object_id *oid)
}
const struct packed_git *has_packed_and_bad(struct repository *r,
const unsigned char *sha1)
const struct object_id *oid)
{
struct packed_git *p;
unsigned i;
for (p = r->objects->packed_git; p; p = p->next)
for (i = 0; i < p->num_bad_objects; i++)
if (hasheq(sha1,
if (hasheq(oid->hash,
p->bad_object_sha1 + the_hash_algo->rawsz * i))
return p;
return NULL;