diff options
author | Daniel Barkalow <barkalow@iabervon.org> | 2009-11-18 04:42:22 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-18 08:45:44 +0300 |
commit | fb0cc87ec0f1e9c13b27ea2c89127991d44ed3d3 (patch) | |
tree | 04e16037f6f5a3e20d621e0f1c91cc33ba730439 /builtin-ls-remote.c | |
parent | f2a37151d4624906e34a9bcafb2ad79d0e8cb7ec (diff) |
Allow programs to not depend on remotes having urls
For fetch and ls-remote, which use the first url of a remote, have
transport_get() determine this by passing a remote and passing NULL
for the url. For push, which uses every url of a remote, use each url
in turn if there are any, and use NULL if there are none.
This will allow the transport code to do something different if the
location is not specified with a url.
Also, have the message for a fetch say "foreign" if there is no url.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-ls-remote.c')
-rw-r--r-- | builtin-ls-remote.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c index 78a88f7476..d625df2f4e 100644 --- a/builtin-ls-remote.c +++ b/builtin-ls-remote.c @@ -89,7 +89,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) remote = nongit ? NULL : remote_get(dest); if (remote && !remote->url_nr) die("remote %s has no configured URL", dest); - transport = transport_get(remote, remote ? remote->url[0] : dest); + transport = transport_get(remote, NULL); if (uploadpack != NULL) transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack); |