aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/add.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/add.c
parent98518304c5761ba04cefb6d73c5698db7e46d1c2 (diff)
downloadgit-b3361447256bb92a1dbdda910a33cfb1d6fc8f88.tar.gz
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/add.c')
-rw-r--r--builtin/add.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 0235854f80..740c7c4581 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -389,6 +389,7 @@ int cmd_add(int argc,
char *seen = NULL;
char *ps_matched = NULL;
struct lock_file lock_file = LOCK_INIT;
+ struct odb_transaction *transaction;
repo_config(repo, add_config, NULL);
@@ -574,7 +575,7 @@ int cmd_add(int argc,
string_list_clear(&only_match_skip_worktree, 0);
}
- begin_odb_transaction();
+ transaction = begin_odb_transaction(repo->objects);
ps_matched = xcalloc(pathspec.nr, 1);
if (add_renormalize)
@@ -593,7 +594,7 @@ int cmd_add(int argc,
if (chmod_arg && pathspec.nr)
exit_status |= chmod_pathspec(repo, &pathspec, chmod_arg[0], show_only);
- end_odb_transaction();
+ end_odb_transaction(transaction);
finish:
if (write_locked_index(repo->index, &lock_file,