mirror of
https://github.com/git/git
synced 2024-10-04 07:39:24 +00:00
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
This commit is contained in:
commit
48c12d4b9b
|
@ -424,6 +424,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
fprintf(stderr, "Initialize %s\n", git_dir);
|
fprintf(stderr, "Initialize %s\n", git_dir);
|
||||||
init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
|
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)
|
if (option_reference)
|
||||||
setup_reference(git_dir);
|
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);
|
refs = clone_local(path, git_dir);
|
||||||
else {
|
else {
|
||||||
struct remote *remote = remote_get(argv[0]);
|
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)
|
if (!transport->get_refs_list || !transport->fetch)
|
||||||
die("Don't know how to clone %s", transport->url);
|
die("Don't know how to clone %s", transport->url);
|
||||||
|
|
Loading…
Reference in a new issue