]> git.ipfire.org Git - thirdparty/git.git/commit
odb/transaction: propagate commit errors
authorJustin Tobler <jltobler@gmail.com>
Fri, 10 Jul 2026 16:37:18 +0000 (11:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 20:21:53 +0000 (13:21 -0700)
commitdbb3c87ee40d55a1224275de118f0ec19b60ca32
tree73260b3092f0aa77450b126ed46c0bf9e16ba910
parent4576d6c5225fec402fa8d4190abb63e6f938b98d
odb/transaction: propagate commit errors

When `odb_transaction_commit()` is invoked, the return value of the
backend commit callback is silently discarded. A backend has no way
to signal that committing failed, such as when the "files" backend
cannot migrate its temporary object directory into the permanent
ODB.

In a subsequent commit, git-receive-pack(1) starts using ODB transaction
to stage objects and consequently cares about such failures so it can
handle the error appropriately. Change the commit callback signature to
return an int error code and have `odb_transaction_commit()` forward it
accordingly.

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