Re: [PATCH v2] cache-tree: do not lazy-fetch merge tree
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 10, 2019, 01:09 UTC
- Message-ID
- <xmqqwoehgdnk.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190909222101.GB31319@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I wondered also if this means we should be using OBJECT_INFO_QUICK. > I.e., do we expect to see a "miss" here often, forcing us to re-scan the > packed directory?
As a performance optimization hack, it is OK if we did not notice that the tree object, which corresponds to what is currently prepared for a directory in the index, does exist in the object store. It is not worth rescanning the packs to "protect" against races, I think, in the "repair" codepath.
When the user actually wants to write the index out as a tree, we would write it out as a loose object (or omit doing so if we know there are already copies), but because it is not a crime to create a duplicate loose object when we already have a packed copy, I do not think we need to rescan in that context, either. But I do not think the codepath Jonathan's patch touches is about that operation.