Subject: Re: [BUG] git diff --no-index segfaults on large files (NULL object database)

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Apr 2026 13:45:15 -0700

Justin Tobler <[email-masked]> writes:

> IMO it is already questionable as to why we would want to start an ODB
> transaction if it is already known that the object won't be written.
> IOW, if we are only interested in streaming the object to get its hash
> we shouldn't have to start a transaction.

Very well.

> The other option would be as Peff suggested and to make
> `odb_transaction_begin()` just return early with NULL or some type of
> no-op transaction if there is no ODB set up. I do think the former
> approach would be preferable though as I'm not sure there is really a
> good use case for supporting ODB transactions when there isn't an ODB
> set up.

Let's not go there.  I agree that odb transactions without odb does
not make any sense.