Re: [PATCH 2/2] clone: suppress unexpected default branch advice

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

 



On Wed, Mar 19, 2025 at 08:46:46PM -0500, Justin Tobler wrote:
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 9eb66234bc..3b166b05e3 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -1523,7 +1523,7 @@ int cmd_clone(int argc,
>  	}
>  
>  	remote_head = find_ref_by_name(refs, "HEAD");
> -	remote_head_points_at = guess_remote_head(remote_head, mapped_refs, 0, 0);
> +	remote_head_points_at = guess_remote_head(remote_head, mapped_refs, 0, 1);
>  
>  	if (option_branch) {
>  		our_head_points_at = find_remote_branch(mapped_refs, option_branch);

Makes sense. You don't have control over the branch name anyway when
cloning, so it's nonsensical to print that advise. Another subsequent
step could be to turn the `advise()` into `advise_if_enabled()`, but
that change isn't really needed for git-clone(1) because there wouldn't
ever be a reason to print it.

Do we want to add a test somewhere that demonstrates that we don't print
the advise anymore?

Thanks for fixing this!

Patrick




[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