From: Eric Wong Date: Tue, 14 May 2019 23:38:09 GMT Subject: Re: [PATCH] get_oid: handle NULL repo->index Message-ID: <20190514233809.7wnlbb4s6cjhjv63@dcvr> In-Reply-To: <20190514135455.GA17927@sigill.intra.peff.net> Jeff King wrote: > +++ b/sha1-name.c > @@ -1837,7 +1837,7 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo, > if (flags & GET_OID_RECORD_PATH) > oc->path = xstrdup(cp); > > - if (!repo->index->cache) > + if (!repo->index || !repo->index->cache) > repo_read_index(repo); Awesome, looks obviously correct and can confirm it fixes the new segfault :> Now I'm kinda wondering if some static checker coulda/shoulda spotted that, sooner.