Thread (18 messages) flat view 18 messages, 3 authors, 14h ago

Re: [PATCH 1/2] object-file: lift ODB reprepare out of packfile flush

From: Justin Tobler <hidden>
Date: 2026-09-15 08:54:04

On 26/09/15 12:40AM, Karthik Nayak wrote:
Justin Tobler [off-list ref] writes:
quoted
@@ -1260,6 +1260,7 @@ static int odb_transaction_files_commit(struct odb_transaction *base)
 {
 	struct odb_transaction_files *transaction =
 		container_of(base, struct odb_transaction_files, base);
+	int have_packfile = !!transaction->packfile.f;

 	if (transaction->objdir) {
 		struct strbuf temp_path = STRBUF_INIT;
@@ -1293,6 +1294,9 @@ static int odb_transaction_files_commit(struct odb_transaction *base)

 	flush_packfile_transaction(transaction);
Earlier this would unconditionally call `odb_reprepare()` within, now we
only call if needed. Which makes sense. Would it also make sense to only
call `flush_packfile_transaction(transaction)` if we have a packfile?
`flush_packfile_transaction()` already returns early if there is nothing
to do. We could make it more explicit here, but I think it is probably
fine to leave it as-is.

-Justin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help