aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/unpack-objects.c
diff options
context:
space:
mode:
authorJustin Tobler <jltobler@gmail.com>2025-08-22 16:34:58 -0500
committerJunio C Hamano <gitster@pobox.com>2025-08-25 09:48:13 -0700
commitb3361447256bb92a1dbdda910a33cfb1d6fc8f88 (patch)
treed6d52cf269972a5950dc7aac44204e2a16d274bb /builtin/unpack-objects.c
parentbulk-checkin: introduce object database transaction structure (diff)
downloadgit-b3361447256bb92a1dbdda910a33cfb1d6fc8f88.tar.gz
git-b3361447256bb92a1dbdda910a33cfb1d6fc8f88.zip
bulk-checkin: remove global transaction state
Object database transactions in the bulk-checkin subsystem rely on global state to track transaction status. Stop relying on global state and instead store the transaction in the `struct object_database`. Functions that operate on transactions are updated to now wire transaction state. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/unpack-objects.c')
-rw-r--r--builtin/unpack-objects.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 7ae7c82b6c..28124b324d 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -584,6 +584,7 @@ static void unpack_all(void)
{
int i;
unsigned char *hdr = fill(sizeof(struct pack_header));
+ struct odb_transaction *transaction;
if (get_be32(hdr) != PACK_SIGNATURE)
die("bad pack file");
@@ -599,12 +600,12 @@ static void unpack_all(void)
progress = start_progress(the_repository,
_("Unpacking objects"), nr_objects);
CALLOC_ARRAY(obj_list, nr_objects);
- begin_odb_transaction();
+ transaction = begin_odb_transaction(the_repository->objects);
for (i = 0; i < nr_objects; i++) {
unpack_one(i);
display_progress(progress, i + 1);
}
- end_odb_transaction();
+ end_odb_transaction(transaction);
stop_progress(&progress);
if (delta_list)