t3404: todo list with commented-out commands only aborts
[gitweb.git] / connect.c
index b34dc80451fb375b112c1338a0aa3326a0a168ad..968e91b18c09e5ac814328e0f833e2d4aa91cf2c 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -14,6 +14,7 @@
 #include "strbuf.h"
 #include "version.h"
 #include "protocol.h"
+#include "alias.h"
 
 static char *server_capabilities_v1;
 static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT;
@@ -408,7 +409,8 @@ static int process_ref_v2(const char *line, struct ref ***list)
 
 struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
                             struct ref **list, int for_push,
-                            const struct argv_array *ref_prefixes)
+                            const struct argv_array *ref_prefixes,
+                            const struct string_list *server_options)
 {
        int i;
        *list = NULL;
@@ -419,6 +421,12 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
        if (server_supports_v2("agent", 0))
                packet_write_fmt(fd_out, "agent=%s", git_user_agent_sanitized());
 
+       if (server_options && server_options->nr &&
+           server_supports_v2("server-option", 1))
+               for (i = 0; i < server_options->nr; i++)
+                       packet_write_fmt(fd_out, "server-option=%s",
+                                        server_options->items[i].string);
+
        packet_delim(fd_out);
        /* When pushing we don't want to request the peeled tags */
        if (!for_push)