When `odb_transaction_begin()` is invoked, the function returns the transaction pointer directly. There is no way for the backend to signal that it failed to set up its state, such as when creating the temporary object directory backing the transaction. In a subsequent commit, git-receive-pack(1) starts using ODB transactions and needs to be able to report such failures rather than silently ignore them. Refactor `odb_transaction_begin()` to return an int error code and write the resulting transaction into an out parameter. Also introduce `odb_transaction_begin_or_die()` as a convenience for callsites that do not need to handle errors explicitly. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
|---|---|---|
| .. | ||
| source-files.c | ||
| source-files.h | ||
| source-inmemory.c | ||
| source-inmemory.h | ||
| source-loose.c | ||
| source-loose.h | ||
| source.c | ||
| source.h | ||
| streaming.c | ||
| streaming.h | ||
| transaction.c | ||
| transaction.h | ||