Re: [PATCH 4/4] git status: refresh the index
- From
Markus Heidelberg <markus.heidelberg@web.de>
- Date
- Apr 2, 2010, 20:37 UTC
- Message-ID
- <201004022237.04130.markus.heidelberg@web.de>
- In-Reply-To
- <20100402165759.GB18576@coredump.intra.peff.net>
Jeff King, 2010-04-02 18:57:
Show 8 quoted lines
> On Fri, Apr 02, 2010 at 02:27:21PM +0200, Markus Heidelberg wrote:
>
> > + fd = hold_locked_index(&index_lock, 1);
> > + if (write_cache(fd, active_cache, active_nr) ||
> > + commit_locked_index(&index_lock))
> > + die("unable to write new_index file");
>
> Does this mean we will fail to run in a read-only repository?You're right. But that was already the case when "status" was "commit --dry-run". I have to admit, I didn't think about this scenario, but simply looked for the differences between these two commands.
> I think > that status, like diff, should refresh the index on disk if it _can_, > but as that refresh is a side effect of the main purpose (which is to > output information), it should not be fatal if it cannot do so.
Sounds sensible.
Markus