From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Greg Pflaum <greg.pflaum@pnp-hcl.com>
Subject: Re: [PATCH] clone: clean up directory after transport_fetch_refs() failure
Date: Wed, 19 May 2021 10:30:29 -0400 [thread overview]
Message-ID: <YKUhBdO1KSiLwqOZ@nand.local> (raw)
In-Reply-To: <YKTzu96fN7XlpDoG@coredump.intra.peff.net>
On Wed, May 19, 2021 at 07:17:15AM -0400, Jeff King wrote:
> 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
prev parent reply other threads:[~2021-05-19 14:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 11:17 [PATCH] clone: clean up directory after transport_fetch_refs() failure Jeff King
2021-05-19 14:30 ` Taylor Blau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YKUhBdO1KSiLwqOZ@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=greg.pflaum@pnp-hcl.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).