Code

everyday: use the dashless form of git-init
[git.git] / builtin-ls-remote.c
index 720280e3900dc65a5063306a55880b8bc1330c2a..78a88f74769645f0be86aa77d3dee3f5e99c916f 100644 (file)
@@ -4,7 +4,7 @@
 #include "remote.h"
 
 static const char ls_remote_usage[] =
-"git-ls-remote [--upload-pack=<git-upload-pack>] [<host>:]<directory>";
+"git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...";
 
 /*
  * Is there one among the list of patterns that match the tail part
@@ -31,7 +31,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 {
        int i;
        const char *dest = NULL;
-       int nongit = 0;
+       int nongit;
        unsigned flags = 0;
        const char *uploadpack = NULL;
        const char **pattern = NULL;
@@ -94,6 +94,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
 
        ref = transport_get_remote_refs(transport);
+       if (transport_disconnect(transport))
+               return 1;
        for ( ; ref; ref = ref->next) {
                if (!check_ref_type(ref, flags))
                        continue;