mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01: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
10
odb.c
10
odb.c
@@ -1051,3 +1051,13 @@ void odb_clear(struct object_database *o)
|
||||
hashmap_clear(&o->pack_map);
|
||||
string_list_clear(&o->submodule_source_paths, 0);
|
||||
}
|
||||
|
||||
struct odb_transaction *odb_transaction_begin(struct object_database *odb)
|
||||
{
|
||||
return object_file_transaction_begin(odb->sources);
|
||||
}
|
||||
|
||||
void odb_transaction_commit(struct odb_transaction *transaction)
|
||||
{
|
||||
object_file_transaction_commit(transaction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user