Re: [PATCH 4/6] require_clean_work_tree: ensure that the index was read
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 30, 2016, 14:46 UTC
- Message-ID
- <alpine.DEB.2.20.1608301645170.129229@virtualbox>
- In-Reply-To
- <alpine.DEB.2.20.1608301300010.129229@virtualbox>
Hi Junio,
On Tue, 30 Aug 2016, Johannes Schindelin wrote:
Show 14 quoted lines
> On Mon, 29 Aug 2016, Junio C Hamano wrote: > > > Junio C Hamano <gitster@pobox.com> writes: > > > > > I am not sure if it should be left as the responsibility of the > > > caller (i.e. check the_index.initialized to bark at a caller that > > > forgets to read from an index) ... > > > > Scatch that. That would not work in a freshly created repository > > before doing any "git add". An empty index is a normal state, so it > > would not just be annoying to warn "You called me without reading > > the index" but is simply wrong. > > Fine. I changed it to assert that the_index.initialized was set.
Alas, that does not work, either. If no .git/index exists, read_index() will not set the "initialized" flag.
So it turns out that I can either get distracted in a major way, or drop the patch. I opt for the latter.
Ciao, Dscho