diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-07-02 09:59:01 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-07-02 09:59:01 -0700 |
| commit | ca463101c8978910c45d9a053dc1af07d42a8664 (patch) | |
| tree | 66e0f54a02bf160b2476427202f9cbc3e92527e2 /builtin/ls-remote.c | |
| parent | 24cbd291640b3c596ded00265a8f62aa55206163 (diff) | |
| parent | aecd794fca275b42e271b80236e95f0d288bd709 (diff) | |
| download | git-ca463101c8978910c45d9a053dc1af07d42a8664.tar.gz | |
Merge branch 'jk/remote-wo-url'
Memory ownership rules for the in-core representation of
remote.*.url configuration values have been straightened out, which
resulted in a few leak fixes and code clarification.
* jk/remote-wo-url:
remote: drop checks for zero-url case
remote: always require at least one url in a remote
t5801: test remote.*.vcs config
t5801: make remote-testgit GIT_DIR setup more robust
remote: allow resetting url list
config: document remote.*.url/pushurl interaction
remote: simplify url/pushurl selection
remote: use strvecs to store remote url/pushurl
remote: transfer ownership of memory in add_url(), etc
remote: refactor alias_url() memory ownership
archive: fix check for missing url
Diffstat (limited to 'builtin/ls-remote.c')
| -rw-r--r-- | builtin/ls-remote.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index 69841ed49f..debf2d4f88 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -112,11 +112,9 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) die("bad repository '%s'", dest); die("No remote configured to list refs from."); } - if (!remote->url_nr) - die("remote %s has no configured URL", dest); if (get_url) { - printf("%s\n", *remote->url); + printf("%s\n", remote->url.v[0]); return 0; } @@ -133,7 +131,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) } if (!dest && !quiet) - fprintf(stderr, "From %s\n", *remote->url); + fprintf(stderr, "From %s\n", remote->url.v[0]); for ( ; ref; ref = ref->next) { struct ref_array_item *item; if (!check_ref_type(ref, flags)) |
