Jeff King <p...@peff.net> 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.

Reply via email to