Re: [PATCH 2/2] clone: respect url.insteadOf setting in global configs

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

 



On Fri, 27 Jun 2008, Johannes Schindelin wrote:

> When we call "git clone" with a url that has a rewrite rule in either
> $HOME/.gitconfig or /etc/gitconfig, the URL can be different from
> what the command line expects it to be.
> 
> So, let's use the URL as the remote structure has it, not the literal
> string from the command line.

This is how it should be.

Maybe I ought to make transport_get() take the index of the URL in the 
list for the remote, instead of taking the actual URL; any use of a URL 
that's not from that list is going to be oddly wrong in some way, I think.

Thanks for taking care of this.

> Noticed by Pieter de Bie.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
> ---
>  builtin-clone.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin-clone.c b/builtin-clone.c
> index 965b5fc..8dda52a 100644
> --- a/builtin-clone.c
> +++ b/builtin-clone.c
> @@ -463,7 +463,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>  		refs = clone_local(path, git_dir);
>  	else {
>  		struct remote *remote = remote_get(argv[0]);
> -		struct transport *transport = transport_get(remote, argv[0]);
> +		struct transport *transport =
> +			transport_get(remote, remote->url[0]);
>  
>  		if (!transport->get_refs_list || !transport->fetch)
>  			die("Don't know how to clone %s", transport->url);
> -- 
> 1.5.6.173.gde14c
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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