diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index 023754986e347a9529d6295d600f665f32f14577..8907a89d6c3914f4652ef387776f581015778396 100644 (file)
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
ref = transport_get_remote_refs(transport);
- transport_disconnect(transport);
-
- if (!ref)
+ if (transport_disconnect(transport))
return 1;
-
for ( ; ref; ref = ref->next) {
if (!check_ref_type(ref, flags))
continue;