Re: [PATCH] parse_object: try internal cache before reading object db
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2012, 21:55 UTC
- Message-ID
- <7vehvdn7at.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120105214941.GA31836@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> The worst potential problem I could come up with is if you somehow had > an object whose "parsed" flag was set, but somehow didn't have its other > fields set (like type). > ... > So I think it is safe short of somebody doing some horrible manual > munging of a "struct object".
Yeah, I was worried about codepaths like commit-pretty-printing might be mucking with the contents of commit->buffer, perhaps reencoding the text and then calling parse_object() to get the unmodified original back, or something silly like that. But the lookup_object() call at the beginning of the parse_object() already prevents us from doing such a thing, so we should be OK, I would think.