summaryrefslogtreecommitdiffstats
path: root/list-objects.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-12-03 15:44:00 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-04 00:21:54 +0100
commitc87910b96b1223d4a1dfe65c04e03863fadef6bc (patch)
tree4fbd9e0eda5efb0be743f8b354e19200253d52a1 /list-objects.c
parentpackfile: pass down repository to `has_object[_kept]_pack` (diff)
downloadgit-c87910b96b1223d4a1dfe65c04e03863fadef6bc.tar.xz
git-c87910b96b1223d4a1dfe65c04e03863fadef6bc.zip
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>
Diffstat (limited to 'list-objects.c')
-rw-r--r--list-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/list-objects.c b/list-objects.c
index 31236a8dc9..d11a389b3a 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -75,7 +75,7 @@ static void process_blob(struct traversal_context *ctx,
*/
if (ctx->revs->exclude_promisor_objects &&
!repo_has_object_file(the_repository, &obj->oid) &&
- is_promisor_object(&obj->oid))
+ is_promisor_object(ctx->revs->repo, &obj->oid))
return;
pathlen = path->len;
@@ -180,7 +180,7 @@ static void process_tree(struct traversal_context *ctx,
* an incomplete list of missing objects.
*/
if (revs->exclude_promisor_objects &&
- is_promisor_object(&obj->oid))
+ is_promisor_object(revs->repo, &obj->oid))
return;
if (!revs->do_not_die_on_missing_objects)