From: Junio C Hamano Date: Thu, 16 May 2019 01:43:34 GMT Subject: Re: [PATCH] get_oid: handle NULL repo->index Message-ID: In-Reply-To: Duy Nguyen 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.