mirror of
https://github.com/git/git.git
synced 2026-01-09 01:34:00 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ed0f5f93e9
commit
ce1661f9da
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user