]> git.ipfire.org Git - thirdparty/git.git/commitdiff
odb/transaction: use pluggable `begin_transaction()`
authorJustin Tobler <jltobler@gmail.com>
Thu, 2 Apr 2026 21:32:15 +0000 (16:32 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Apr 2026 21:52:57 +0000 (14:52 -0700)
Each ODB source is expected to provide an ODB transaction implementation
that should be used when starting a transaction. With d6fc6fe6f8
(odb/source: make `begin_transaction()` function pluggable, 2026-03-05),
the `struct odb_source` now provides a pluggable callback for beginning
transactions. Use the callback provided by the ODB source accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
odb/transaction.c

index 9bf3f347dcf261fc4747c21585cc5453ea2cad09..592ac840759a074ccf74236df43e331a8a1a9683 100644 (file)
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "object-file.h"
+#include "odb/source.h"
 #include "odb/transaction.h"
 
 struct odb_transaction *odb_transaction_begin(struct object_database *odb)
@@ -7,7 +7,7 @@ struct odb_transaction *odb_transaction_begin(struct object_database *odb)
        if (odb->transaction)
                return NULL;
 
-       odb->transaction = odb_transaction_files_begin(odb->sources);
+       odb_source_begin_transaction(odb->sources, &odb->transaction);
 
        return odb->transaction;
 }