aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:22 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-01 16:22:22 -0700
commit48c12d4b9b5a3cd033e6e8acbd38ffd5e6b13797 (patch)
tree4b63adfe3edc79c94b6502b9a2841424a150fc82
parent24cd49f627ab0d313f8f7925e1f6f855563fea43 (diff)
parent5b8063b5b0f56f0da345e8dd7c66d3aced1af673 (diff)
downloadgit-48c12d4b9b5a3cd033e6e8acbd38ffd5e6b13797.tar.gz
git-48c12d4b9b5a3cd033e6e8acbd38ffd5e6b13797.tar.xz
Merge branch 'js/maint-clone-insteadof'
* js/maint-clone-insteadof: clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig clone: respect url.insteadOf setting in global configs
-rw-r--r--builtin-clone.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin-clone.c b/builtin-clone.c
index f13845fb7..643c7d416 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -424,6 +424,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
fprintf(stderr, "Initialize %s\n", git_dir);
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
+ /*
+ * At this point, the config exists, so we do not need the
+ * environment variable. We actually need to unset it, too, to
+ * re-enable parsing of the global configs.
+ */
+ unsetenv(CONFIG_ENVIRONMENT);
+
if (option_reference)
setup_reference(git_dir);
@@ -456,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);