coccicheck: introduce 'pending' semantic patches
[gitweb.git] / builtin / ls-remote.c
index ca3f04a839e79ecf361df5a1997da05c5d59a62d..6a0cdec30d2d77711d880f5e4b6ba6ff981e2e8d 100644 (file)
@@ -47,6 +47,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
        const char **pattern = NULL;
        struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
        int i;
+       struct string_list server_options = STRING_LIST_INIT_DUP;
 
        struct remote *remote;
        struct transport *transport;
@@ -73,6 +74,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                              2, PARSE_OPT_NOCOMPLETE),
                OPT_BOOL(0, "symref", &show_symref_target,
                         N_("show underlying ref in addition to the object pointed by it")),
+               OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
                OPT_END()
        };
 
@@ -116,6 +118,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
        transport = transport_get(remote, NULL);
        if (uploadpack != NULL)
                transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
+       if (server_options.nr)
+               transport->server_options = &server_options;
 
        ref = transport_get_remote_refs(transport, &ref_prefixes);
        if (transport_disconnect(transport)) {
@@ -147,6 +151,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
        }
 
        UNLEAK(sorting);
-       UNLEAK(ref_array);
+       ref_array_clear(&ref_array);
        return status;
 }