builtin-remote: Make "remote show" display all urls
Currently, "git remote -v" lists all urls whereas "git remote show $remote" shows only the first. Make it so that both show all. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Jun 6, 2009 at 17:16 UTC
956d27a872a70f40f98c3f710553ef619959e212
1 file changed
+6
-3
builtin-remote.c
+6
-3
@@ -1003,9 +1003,12 @@ static int show(int argc, const char **argv)
1003
1004
get_remote_ref_states(*argv, &states, query_flag);
1005
1006
- printf("* remote %s\n URL: %s\n", *argv,
1007
- states.remote->url_nr > 0 ?
1008
- states.remote->url[0] : "(no URL)");
1006
+ printf("* remote %s\n", *argv);
1007
+ if (states.remote->url_nr) {
1008
+ for (i=0; i < states.remote->url_nr; i++)
1009
+ printf(" URL: %s\n", states.remote->url[i]);
1010
+ } else
1011
+ printf(" URL: %s\n", "(no URL)");
1012
if (no_query)
1013
printf(" HEAD branch: (not queried)\n");
1014
else if (!states.heads.nr)