From cc656f4eb2b7b10bc530c96844909c869bdd1fdf Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Tue, 3 Dec 2024 15:43:59 +0100 Subject: packfile: pass down repository to `has_object[_kept]_pack` The functions `has_object[_kept]_pack` currently rely 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 these functions and any related ones. Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano --- list-objects.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'list-objects.c') diff --git a/list-objects.c b/list-objects.c index 985d008799..31236a8dc9 100644 --- a/list-objects.c +++ b/list-objects.c @@ -41,7 +41,8 @@ static void show_object(struct traversal_context *ctx, { if (!ctx->show_object) return; - if (ctx->revs->unpacked && has_object_pack(&object->oid)) + if (ctx->revs->unpacked && has_object_pack(ctx->revs->repo, + &object->oid)) return; ctx->show_object(object, name, ctx->show_data); -- cgit v1.2.3