author | Daniel Barkalow <barkalow@iabervon.org> | |
Wed, 4 Nov 2009 02:38:51 +0000 (21:38 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 4 Nov 2009 05:39:28 +0000 (21:39 -0800) | ||
commit | c1d45cf7b0c1953eed72a3018b5e557dbcd538e0 | |
tree | 1840f9d24721f43b1a8c3b693b3c75410529d08b | tree | snapshot |
parent | b26f39cd9739ea1b4149c7ff79469d953440c913 | commit | diff |
Require a struct remote in transport_get()
cmd_ls_remote() was calling transport_get() with a NULL remote and a
non-NULL url in the case where it was run outside a git
repository. This involved a bunch of ill-tested special
cases. Instead, simply get the struct remote for the URL with
remote_get(), which works fine outside a git repository, and can also
take global options into account.
This fixes a tiny and obscure bug where "git ls-remote" without a repo
didn't support global url.*.insteadOf, even though "git clone" and
"git ls-remote" in any repo did.
Also, enforce that all callers provide a struct remote to transport_get().
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cmd_ls_remote() was calling transport_get() with a NULL remote and a
non-NULL url in the case where it was run outside a git
repository. This involved a bunch of ill-tested special
cases. Instead, simply get the struct remote for the URL with
remote_get(), which works fine outside a git repository, and can also
take global options into account.
This fixes a tiny and obscure bug where "git ls-remote" without a repo
didn't support global url.*.insteadOf, even though "git clone" and
"git ls-remote" in any repo did.
Also, enforce that all callers provide a struct remote to transport_get().
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-ls-remote.c | diff | blob | history | |
transport.c | diff | blob | history |