diff options
author | Stefan Beller <sbeller@google.com> | 2018-10-17 02:35:33 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-19 10:21:10 +0300 |
commit | 33b94066f27199071abaa4067d29a98bbbbdae11 (patch) | |
tree | c884dec2172508445bc0f23abf6a9e655384ffee /packfile.c | |
parent | 1b9b5c695e34051c80c9240fdb22e7c89ff0fd5f (diff) |
packfile: allow has_packed_and_bad to handle arbitrary repositories
has_packed_and_bad is not widely used, so just migrate it all at once.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r-- | packfile.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c index 841b36182f..bc2e0f5043 100644 --- a/packfile.c +++ b/packfile.c @@ -1131,12 +1131,13 @@ void mark_bad_packed_object(struct packed_git *p, const unsigned char *sha1) p->num_bad_objects++; } -const struct packed_git *has_packed_and_bad(const unsigned char *sha1) +const struct packed_git *has_packed_and_bad(struct repository *r, + const unsigned char *sha1) { struct packed_git *p; unsigned i; - for (p = the_repository->objects->packed_git; p; p = p->next) + for (p = r->objects->packed_git; p; p = p->next) for (i = 0; i < p->num_bad_objects; i++) if (hasheq(sha1, p->bad_object_sha1 + the_hash_algo->rawsz * i)) |