diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-18 22:16:54 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-18 22:16:54 +0400 |
commit | 199d4c0d434623eafc3a93dddad756ec029f57ff (patch) | |
tree | cb8eb35bb0ee25fef1aedcd97c23f6f1c4b3e0de /builtin | |
parent | 6c6f87842bcb8ac4d36922cec5b5ce25de14756e (diff) | |
parent | cefb2a5e39b165146aee3b093872721cc1155a87 (diff) |
Merge branch 'rc/ls-remote-default'
* rc/ls-remote-default:
ls-remote: print URL when no repo is specified
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/ls-remote.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index 8ee91eb547..34480cfad6 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -5,7 +5,7 @@ static const char ls_remote_usage[] = "git ls-remote [--heads] [--tags] [-u <exec> | --upload-pack <exec>]\n" -" [<repository> [<refs>...]]"; +" [-q|--quiet] [<repository> [<refs>...]]"; /* * Is there one among the list of patterns that match the tail part @@ -34,6 +34,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) const char *dest = NULL; int nongit; unsigned flags = 0; + int quiet = 0; const char *uploadpack = NULL; const char **pattern = NULL; @@ -67,6 +68,10 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) flags |= REF_NORMAL; continue; } + if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) { + quiet = 1; + continue; + } usage(ls_remote_usage); } dest = arg; @@ -99,6 +104,9 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) ref = transport_get_remote_refs(transport); if (transport_disconnect(transport)) return 1; + + if (!dest && !quiet) + fprintf(stderr, "From %s\n", *remote->url); for ( ; ref; ref = ref->next) { if (!check_ref_type(ref, flags)) continue; |