Re: [PATCH 1/2] fetch: only respect followRemoteHEAD with configured refspecs
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 18, 2025, 23:02 UTC
- Message-ID
- <Z9n7f2P7AOKD2Pc1@nand.local>
- In-Reply-To
- <20250318054017.GA2051617@coredump.intra.peff.net>
On Tue, Mar 18, 2025 at 01:40:17AM -0400, Jeff King wrote:
Show 9 quoted lines
> @@ -1918,7 +1905,7 @@ static int do_fetch(struct transport *transport, > "you need to specify exactly one branch with the --set-upstream option")); > } > } > - if (set_head(remote_refs, transport->remote)) > + if (do_set_head && set_head(remote_refs, transport->remote)) > ; > /* > * Way too many cases where this can go wrong
This empty "if" statement is a little odd, though not the fault of your patch. I probably would have rewritten this like:
if (do_set_head) {
/*
* Way too many cases where this can go wrong
* so let's just fail silently for now.
*/
set_head(remote, transport->remote);
}, but it's obviously NBD here, just something I noticed idly while reading the rest of the patch, which looks great to me.
Thanks, Taylor