packfile: pass down repository to for_each_packed_object
The function `for_each_packed_object` currently relies on the global variable `the_repository`. To eliminate global variable usage in `packfile.c`, we should progressively shift the dependency on the_repository to higher layers. Let's remove its usage from this function and closely related function `is_promisor_object`. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
cc656f4eb2
commit
c87910b96b
2
fsck.c
2
fsck.c
@@ -1295,7 +1295,7 @@ static int fsck_blobs(struct oidset *blobs_found, struct oidset *blobs_done,
|
||||
|
||||
buf = repo_read_object_file(the_repository, oid, &type, &size);
|
||||
if (!buf) {
|
||||
if (is_promisor_object(oid))
|
||||
if (is_promisor_object(the_repository, oid))
|
||||
continue;
|
||||
ret |= report(options,
|
||||
oid, OBJ_BLOB, msg_missing,
|
||||
|
||||
Reference in New Issue
Block a user