Skip to content

Commit

Permalink
clone: respect url.insteadOf setting in global configs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jun 27, 2008
1 parent 7ac749c commit bc0c0d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bc0c0d8

Please sign in to comment.