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

Re: [PATCH] clone: clean up directory after transport_fetch_refs() failure

From
Taylor Blau <me@ttaylorr.com>
Date
May 19, 2021, 14:30 UTC
Message-ID
<YKUhBdO1KSiLwqOZ@nand.local>
In-Reply-To
<YKTzu96fN7XlpDoG@coredump.intra.peff.net>
On Wed, May 19, 2021 at 07:17:15AM -0400, Jeff King wrote:
Show 14 quoted lines
> One obvious option to fix this is to reorder the end of the function to
> set the flag first, before cleanup code, and put the label between them.
>
> But we can observe another small bug: the error return from
> transport_fetch_refs() is generally "-1", and we propagate that to the
> return value of cmd_clone(), which ultimately becomes the exit code of
> the process. And we try to avoid transmitting negative values via exit
> codes (only the low 8 bits are passed along as an unsigned value, though
> in practice for "-1" this at least retains the property that it's
> non-zero).
>
> Instead, let's just die(). That makes us consistent with rest of the
> code in the function. It does add a new "fatal:" line to the output, but
> I'd argue that's a good thing:
This reasoning makes sense to me, and thanks for cleaning this up.
    Reviewed-by: Taylor Blau <me@ttaylorr.com>

Thanks, Taylor

Previous: Jeff King
Message 2 of 2 in “clone: clean up directory after transport_fetch_refs() failure”
  1. clone: clean up directory after transport_fetch_refs() failureJeff King, May 19, 2021
  2. Taylor BlauMay 19, 2021

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.