summaryrefslogtreecommitdiff
path: root/builtin-clone.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-06-27 13:56:05 +0100
committerJunio C Hamano <gitster@pobox.com>2008-06-27 16:21:19 -0700
commitbc0c0d81561bdbb8cb5e1f3af558390f1a0c86cb (patch)
treec0fee78a203724779cfd2c3a14fec32f1ffb9360 /builtin-clone.c
parent7ac749c96d143ba4f76723959892cbaddbe8ed07 (diff)
downloadgit-bc0c0d81561bdbb8cb5e1f3af558390f1a0c86cb.tar.gz
clone: respect url.insteadOf setting in global configs
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> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-clone.c')
-rw-r--r--builtin-clone.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-clone.c b/builtin-clone.c
index b2dfe1ab5c..9c028e76a5 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -452,7 +452,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);