diff options
| author | Justin Tobler <jltobler@gmail.com> | 2025-09-16 13:29:38 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-16 11:37:06 -0700 |
| commit | ce1661f9da70ea2ffcb54f7b544410fad26e965d (patch) | |
| tree | 3c6c03b10aa74bdece59ddae976af6550bca1ee0 /read-cache.c | |
| parent | ed0f5f93e9f0b0b3cc1a37ee5b10b625590f08c8 (diff) | |
odb: add transaction interface
Transactions are managed via the {begin,end}_odb_transaction() function
in the object-file subsystem and its implementation is specific to the
files object source. Introduce odb_transaction_{begin,commit}() in the
odb subsystem to provide an eventual object source agnostic means to
manage transactions.
Update call sites to instead manage transactions through the odb
subsystem. Also rename {begin,end}_odb_transaction() functions to
object_file_transaction_{begin,commit}() to clarify the object source it
supports.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
| -rw-r--r-- | read-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c index 80591eeced..94098a3861 100644 --- a/read-cache.c +++ b/read-cache.c @@ -3972,9 +3972,9 @@ int add_files_to_cache(struct repository *repo, const char *prefix, * This function is invoked from commands other than 'add', which * may not have their own transaction active. */ - transaction = begin_odb_transaction(repo->objects); + transaction = odb_transaction_begin(repo->objects); run_diff_files(&rev, DIFF_RACY_IS_MODIFIED); - end_odb_transaction(transaction); + odb_transaction_commit(transaction); release_revisions(&rev); return !!data.add_errors; |
