Skip to content

Commit 956d27a

Browse files
Michael J Grubergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 801a011 commit 956d27a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

builtin-remote.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,12 @@ static int show(int argc, const char **argv)
10031003

10041004
get_remote_ref_states(*argv, &states, query_flag);
10051005

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)");
10091012
if (no_query)
10101013
printf(" HEAD branch: (not queried)\n");
10111014
else if (!states.heads.nr)

0 commit comments

Comments
 (0)