From: Junio C Hamano Date: Thu, 05 Jan 2012 21:55:22 GMT Subject: Re: [PATCH] parse_object: try internal cache before reading object db Message-ID: <7vehvdn7at.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120105214941.GA31836@sigill.intra.peff.net> Jeff King writes: > 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.