Web lists-archives.com

Re: [PATCH] get_oid: handle NULL repo->index




Duy Nguyen <pclouds@xxxxxxxxx> writes:

>> 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.
>
> For repo_read_index() case, maybe. But we have a lot of
> "r(epo)->index->something". All or most of these references
> traditionally are the_index.something, which is always safe to
> dereference. Submodule repos with the optionally NULL repo->index
> break this assumption.

Ah, good point.  Thanks for a dose of sanity.