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>
This commit is contained in:
committed by
Junio C Hamano
parent
98518304c5
commit
b336144725
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user