git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
[gitweb.git] / builtin-ls-remote.c
index c2caeeabe2f9d2bce190656a58094b5ebeee4e30..8907a89d6c3914f4652ef387776f581015778396 100644 (file)
@@ -54,11 +54,11 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                                uploadpack = arg + 7;
                                continue;
                        }
-                       if (!strcmp("--tags", arg)) {
+                       if (!strcmp("--tags", arg) || !strcmp("-t", arg)) {
                                flags |= REF_TAGS;
                                continue;
                        }
-                       if (!strcmp("--heads", arg)) {
+                       if (!strcmp("--heads", arg) || !strcmp("-h", arg)) {
                                flags |= REF_HEADS;
                                continue;
                        }
@@ -94,10 +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 (!ref)
+       if (transport_disconnect(transport))
                return 1;
-
        for ( ; ref; ref = ref->next) {
                if (!check_ref_type(ref, flags))
                        continue;