]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jt/odb-transaction' into next
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Sep 2025 20:18:48 +0000 (13:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Sep 2025 20:18:48 +0000 (13:18 -0700)
Continue the work to build on the bulk-checkin infrastructure to
create many objects at once in a transaction and abstract it into
the generic object layer.

* 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

1  2 
builtin/add.c
odb.c
odb.h

diff --cc builtin/add.c
Simple merge
diff --cc odb.c
Simple merge
diff --cc odb.h
index bd7374f92f492b6e0b75178e04f8b65b336acf00,82093753c84ca6125101eb2a7b9762aa30a92369..9e3dd9d6df9db78ce4388bb322b60fea35f7041f
--- 1/odb.h
--- 2/odb.h
+++ b/odb.h
@@@ -193,9 -185,22 +193,22 @@@ struct object_database 
  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. Dies in case the source couldn't
 - * be found.
 + * Find source by its object directory path. Returns a `NULL` pointer in case
 + * the source could not be found.
   */
  struct odb_source *odb_find_source(struct object_database *odb, const char *obj_dir);