X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fls-remote.c;h=34480cfad6a8842d65ae61f6257c597a2a987b33;hb=5b5275f6e9ca6284ca123f729d5a78f409e448fb;hp=8ee91eb547c2bafedd573045c977cc7d0469c95f;hpb=cde3eadad2fcacc90792a31d0c2ed6890f373e63;p=git.git diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index 8ee91eb54..34480cfad 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 | --upload-pack ]\n" -" [ [...]]"; +" [-q|--quiet] [ [...]]"; /* * 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;