From 74d414c9f14a91a3b7bd04972bf3eb9bbe6fd81b Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 10 Mar 2025 08:13:21 +0100 Subject: object: stop depending on `the_repository` There are a couple of functions exposed by "object.c" that implicitly depend on `the_repository`. Remove this dependency by injecting the repository via a parameter. Adapt callers accordingly by simply using `the_repository`, except in cases where the subsystem is already free of the repository. In that case, we instead pass the repository provided by the caller's context. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- midx-write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'midx-write.c') diff --git a/midx-write.c b/midx-write.c index 26d9d8bb14..ac80a8298e 100644 --- a/midx-write.c +++ b/midx-write.c @@ -708,7 +708,7 @@ static int add_ref_to_pending(const char *refname, const char *referent UNUSED, if (!peel_iterated_oid(revs->repo, oid, &peeled)) oid = &peeled; - object = parse_object_or_die(oid, refname); + object = parse_object_or_die(revs->repo, oid, refname); if (object->type != OBJ_COMMIT) return 0; @@ -768,7 +768,7 @@ static int read_refs_snapshot(const char *refs_snapshot, if (*end) die(_("malformed line: %s"), buf.buf); - object = parse_object_or_die(&oid, NULL); + object = parse_object_or_die(revs->repo, &oid, NULL); if (preferred) object->flags |= NEEDS_BITMAP; -- cgit v1.2.3