Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Pieter de Bie <pdebie@ai.rug.nl>
Cc: Git Mailinglist <git@vger.kernel.org>,
	Daniel Barkalow <barkalow@iabervon.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 2/2] clone: respect url.insteadOf setting in global configs
Date: Fri, 27 Jun 2008 13:56:05 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.1.00.0806271355520.9925@racer> (raw)
In-Reply-To: <alpine.DEB.1.00.0806271353350.9925@racer>


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.

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

  reply	other threads:[~2008-06-27 12:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27  9:35 Using url.insteadOf in git-clone Pieter de Bie
2008-06-27 12:55 ` [PATCH 1/2] clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig Johannes Schindelin
2008-06-27 12:56   ` Johannes Schindelin [this message]
2008-06-27 16:08     ` [PATCH 2/2] clone: respect url.insteadOf setting in global configs Daniel Barkalow
2008-06-29 20:12     ` Pieter de Bie
2008-06-29 21:50       ` Johannes Schindelin
2008-06-27 16:05   ` [PATCH 1/2] clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig Daniel Barkalow
2008-06-27 22:40     ` Junio C Hamano
2008-06-29 18:31       ` Daniel Barkalow
2008-06-29 20:36         ` Junio C Hamano
2008-06-29 21:49         ` Johannes Schindelin
2008-06-29 22:47           ` Daniel Barkalow
2008-06-30  0:41             ` Johannes Schindelin
2008-06-30  1:54               ` Daniel Barkalow
2008-06-30  1:20             ` Junio C Hamano
2008-06-30  2:21               ` Daniel Barkalow
2008-06-30  3:47               ` Daniel Barkalow
2008-06-30 11:57                 ` Johannes Schindelin
2008-06-30 16:47                   ` Daniel Barkalow
2008-06-30  6:20           ` Junio C Hamano
2008-06-30  6:25             ` Junio C Hamano
2008-06-30  6:40               ` Jeff King
2008-06-30  6:44                 ` Junio C Hamano
2008-06-30 11:37             ` Johannes Schindelin
2008-06-27 17:11 ` Using url.insteadOf in git-clone Junio C Hamano
2008-06-29 18:59   ` Pieter de Bie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.1.00.0806271355520.9925@racer \
    --to=johannes.schindelin@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pdebie@ai.rug.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox