git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bug in git-revert

From
Jeff King <peff@peff.net>
Date
Mar 2, 2008, 07:02 UTC
Message-ID
<20080302070221.GA10629@coredump.intra.peff.net>
In-Reply-To
<20080302064449.GA6334@coredump.intra.peff.net>
On Sun, Mar 02, 2008 at 01:44:49AM -0500, Jeff King wrote:
Show 11 quoted lines
> --- a/builtin-revert.c
> +++ b/builtin-revert.c
> @@ -279,6 +279,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
>  		if (get_sha1("HEAD", head))
>  			die ("You do not have a valid HEAD");
>  		wt_status_prepare(&s);
> +		s.fp = NULL;
> +		wt_status_print_updated(&s);
>  		if (s.commitable)
>  			die ("Dirty index: cannot %s", me);
>  		discard_cache();

Actually, this isn't right. It needs to call wt_status_print(&s), since it does some magic that wt_status_print_updated() requires to run correctly.

-Peff
Previous: Johannes SchindelinNext: Jeff King
Message 3 of 7 in “bug in git-revert”
  1. Jeff KingMar 2, 2008
  2. Johannes SchindelinMar 2, 2008
  3. Jeff KingMar 2, 2008
  4. revert: actually check for a dirty indexJeff King, Mar 2, 2008
  5. Alex RiesenMar 2, 2008
  6. Jeff KingMar 3, 2008
  7. Junio C HamanoMar 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.