diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-02 12:26:11 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-02 12:26:11 -0700 |
| commit | fd13909eb63ef121824f243183db6b1f49ef1aed (patch) | |
| tree | 9a70143dbea20d9464bf48cecd287ee484171690 /odb.h | |
| parent | 821f583da6d30a84249f75f33501504d597bc16b (diff) | |
| parent | ce1661f9da70ea2ffcb54f7b544410fad26e965d (diff) | |
Merge branch 'jt/odb-transaction'
The work to build on the bulk-checkin infrastructure to create many
objects at once in a transaction and to abstract it into the
generic object layer continues.
* jt/odb-transaction:
odb: add transaction interface
object-file: update naming from bulk-checkin
object-file: relocate ODB transaction code
bulk-checkin: drop flush_odb_transaction()
builtin/update-index: end ODB transaction when --verbose is specified
bulk-checkin: remove ODB transaction nesting
Diffstat (limited to 'odb.h')
| -rw-r--r-- | odb.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -194,6 +194,19 @@ struct object_database *odb_new(struct repository *repo); void odb_clear(struct object_database *o); /* + * Starts an ODB transaction. Subsequent objects are written to the transaction + * and not committed until odb_transaction_commit() is invoked on the + * transaction. If the ODB already has a pending transaction, NULL is returned. + */ +struct odb_transaction *odb_transaction_begin(struct object_database *odb); + +/* + * Commits an ODB transaction making the written objects visible. If the + * specified transaction is NULL, the function is a no-op. + */ +void odb_transaction_commit(struct odb_transaction *transaction); + +/* * Find source by its object directory path. Returns a `NULL` pointer in case * the source could not be found. */ |
