Re: [PATCH 2/2] clone: respect url.insteadOf setting in global configs
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Jun 27, 2008, 16:08 UTC
- Message-ID
- <alpine.LNX.1.00.0806271205430.19665@iabervon.org>
- In-Reply-To
- <alpine.DEB.1.00.0806271355520.9925@racer>
On Fri, 27 Jun 2008, Johannes Schindelin wrote:
Show 6 quoted lines
> 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.
Show 26 quoted lines
> Noticed by Pieter de Bie.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> 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
>
>
>