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:
Justin Tobler
2025-08-22 16:34:58 -05:00
committed by Junio C Hamano
parent 98518304c5
commit b336144725
9 changed files with 99 additions and 57 deletions

8
odb.h
View File

@@ -84,6 +84,7 @@ struct odb_source {
struct packed_git;
struct cached_object_entry;
struct odb_transaction;
/*
* The object database encapsulates access to objects in a repository. It
@@ -94,6 +95,13 @@ struct object_database {
/* Repository that owns this database. */
struct repository *repo;
/*
* State of current current object database transaction. Only one
* transaction may be pending at a time. Is NULL when no transaction is
* configured.
*/
struct odb_transaction *transaction;
/*
* Set of all object directories; the main directory is first (and
* cannot be NULL after initialization). Subsequent directories are