From: Junio C Hamano Date: Tue, 1 Jul 2008 23:22:22 +0000 (-0700) Subject: Merge branch 'js/maint-clone-insteadof' X-Git-Tag: v1.6.0-rc0~178 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/48c12d4b9b5a3cd033e6e8acbd38ffd5e6b13797?ds=inline;hp=-c 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 --- 48c12d4b9b5a3cd033e6e8acbd38ffd5e6b13797 diff --combined builtin-clone.c index f13845fb7f,e9ecb5d21a..643c7d4169 --- a/builtin-clone.c +++ b/builtin-clone.c @@@ -18,7 -18,6 +18,7 @@@ #include "transport.h" #include "strbuf.h" #include "dir.h" +#include "pack-refs.h" /* * Overall FIXMEs: @@@ -322,11 -321,8 +322,11 @@@ static struct ref *write_remote_refs(co get_fetch_map(refs, tag_refspec, &tail, 0); for (r = local_refs; r; r = r->next) - update_ref(reflog, - r->peer_ref->name, r->old_sha1, NULL, 0, DIE_ON_ERR); + add_extra_ref(r->peer_ref->name, r->old_sha1, 0); + + pack_refs(PACK_REFS_ALL); + clear_extra_refs(); + return local_refs; } @@@ -424,6 -420,13 +424,13 @@@ int cmd_clone(int argc, const char **ar 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 -459,8 +463,8 @@@ 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);