From: Junio C Hamano Date: Wed, 15 May 2019 05:16:39 GMT Subject: Re: [PATCH] get_oid: handle NULL repo->index Message-ID: In-Reply-To: <20190515014622.GB13255@sigill.intra.peff.net> Jeff King writes: > Also from my earlier message, if you missed it: > > I also wondered if we should simply allocate an empty index whenever > we have a non-toplevel "struct repository", which might be less > surprising to other callers. I don't have a strong opinion either way. > I did grep around for other callers which might have similar problems, > but couldn't find any. That is an approach to make it harder to make mistakes by accepting possibly a small wasted resource; but at that point, I think calling repo_read_index() unconditionally from here and similar places would be a simpler fix in the same spirit.