diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index c2caeeabe2f9d2bce190656a58094b5ebeee4e30..06ab8da1fb1e5ebc5fedb82e74d7e6a7374cee0e 100644 (file)
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
{
int i;
const char *dest = NULL;
- int nongit = 0;
+ int nongit;
unsigned flags = 0;
const char *uploadpack = NULL;
const char **pattern = NULL;
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;
}
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;