Thread (175 messages) 175 messages, 5 authors, 2024-12-03
STALE568d
Revisions (10)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]
  8. v8 [diff vs current]
  9. v9 [diff vs current]
  10. v10 [diff vs current]

[PATCH 07/20] packfile: use provided repository in `packed_object_info`

From: Karthik Nayak <hidden>
Date: 2024-10-21 09:58:13
Subsystem: the rest · Maintainer: Linus Torvalds

The function `packed_object_info` receives a repository struct as an
argument. Yet, it still uses the global 'the_repository' variable
within, let's swap it with the provided repository variable.

Signed-off-by: Karthik Nayak <redacted>
---
 builtin/pack-objects.c | 2 +-
 packfile.c             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a10eae239e..c2555d4986 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3383,7 +3383,7 @@ static int add_object_entry_from_pack(const struct object_id *oid,
 		struct object_info oi = OBJECT_INFO_INIT;
 
 		oi.typep = &type;
-		if (packed_object_info(the_repository, p, ofs, &oi) < 0) {
+		if (packed_object_info(revs->repo, p, ofs, &oi) < 0) {
 			die(_("could not get type of object %s in pack %s"),
 			    oid_to_hex(oid), p->pack_name);
 		} else if (type == OBJ_COMMIT) {
diff --git a/packfile.c b/packfile.c
index ee46898b35..458db59b3a 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1604,7 +1604,7 @@ int packed_object_info(struct repository *r, struct packed_git *p,
 				goto out;
 			}
 		} else
-			oidclr(oi->delta_base_oid, the_repository->hash_algo);
+			oidclr(oi->delta_base_oid, r->hash_algo);
 	}
 
 	oi->whence = in_delta_base_cache(p, obj_offset) ? OI_DBCACHED :
-- 
2.47.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help