Merge branch 'ab/perl-python-attrs'
[gitweb.git] / connect.c
index 54971166ac4ba6646ea52051f8131dc16ea2e0ae..31aa9c843311b4e0b01e7378a85709083b071311 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -48,7 +48,7 @@ int check_ref_type(const struct ref *ref, int flags)
        return check_ref(ref->name, flags);
 }
 
-static void die_initial_contact(int unexpected)
+static NORETURN void die_initial_contact(int unexpected)
 {
        /*
         * A hang-up after seeing some response from the other end
@@ -408,7 +408,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 +420,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)