summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-10-16 23:35:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-19 07:21:10 (GMT)
commit33b94066f27199071abaa4067d29a98bbbbdae11 (patch)
treec884dec2172508445bc0f23abf6a9e655384ffee /packfile.c
parent1b9b5c695e34051c80c9240fdb22e7c89ff0fd5f (diff)
downloadgit-33b94066f27199071abaa4067d29a98bbbbdae11.zip
git-33b94066f27199071abaa4067d29a98bbbbdae11.tar.gz
git-33b94066f27199071abaa4067d29a98bbbbdae11.tar.bz2
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c
index 841b361..bc2e0f5 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))