From: Junio C Hamano Date: Mon, 09 Sep 2019 17:55:18 GMT Subject: Re: [PATCH 3/3] commit-graph.c: handle corrupt/missing trees Message-ID: In-Reply-To: <20190906172851.GC23181@sigill.intra.peff.net> Jeff King writes: >> Answer. There is a single hit inside fsck.c that wants to report >> an error without killing ourselves in fsck_commit_buffer(). I >> however doubt its use of get_commit_tree() is correct in the >> first place. The function is about validating the commit object >> payload manually, without trusting the result of parse_commit(), >> and it does read the object name of the tree object; the call to >> get_commit_tree() used for reporting the error there should >> probably become has_object() on the tree_oid. > > I actually think that check should be removed entirely. That function is > about checking the syntactic validity of the object itself, not about > connectivity (which is handled separately). We already check that we > have a valid "tree" pointer earlier in the function. Of course, you're right.