Re: bug in git-revert
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 2, 2008, 07:00 UTC
- Message-ID
- <alpine.LSU.1.00.0803020659340.22527@racer.site>
- In-Reply-To
- <20080302064449.GA6334@coredump.intra.peff.net>
Hi,
On Sun, 2 Mar 2008, Jeff King wrote:
Show 19 quoted lines
> In 9509af6 (Make git-revert & git-cherry-pick a builtin), you introduced
> the following code:
>
> 252 } else {
> 253 struct wt_status s;
> 254
> 255 if (get_sha1("HEAD", head))
> 256 die ("You do not have a valid HEAD");
> 257 wt_status_prepare(&s);
> 258 if (s.commitable || s.workdir_dirty)
> 259 die ("Dirty index: cannot %s", me);
> 260 discard_cache();
> 261 }
>
> (where the die condition was later changed to allow a dirty workdir). Am
> I crazy, or is it impossible to trigger either of those conditions?
> wt_status_prepare is about setting up the object to do the actual diff.
> At that point it hasn't actually looked at the index or file contents,
> and so commitable is _always_ 0.Well, then this is my mistake. I haven't looked closely at what wt_status_prepare() does (or did).
Ciao, Dscho