Re: [PATCH 1/2] fetch: only respect followRemoteHEAD with configured refspecs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 18, 2025 at 01:40:17AM -0400, Jeff King wrote:
> @@ -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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux