run_command(): respect GIT_TRACE
[gitweb.git] / builtin-clone.c
index b2dfe1ab5c6df0da0af0004bdf5accd6d37a90d8..7bcc664e44cb684e150221e9c9c4d0fe54357011 100644 (file)
@@ -417,9 +417,15 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                die("could not create leading directories of '%s'", git_dir);
        set_git_dir(make_absolute_path(git_dir));
 
-       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);
 
@@ -452,7 +458,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);