unpack-trees: rename 'is_excluded_from_list()'
[gitweb.git] / transport.c
index 365ea574c7b52e0fc4381295eed6650ca5f67a87..ee7dd1c062fc90b1f8f6a3fd4f3518d9aff58a83 100644 (file)
@@ -224,6 +224,7 @@ static int set_git_option(struct git_transport_options *opts,
                opts->no_dependents = !!value;
                return 0;
        } else if (!strcmp(name, TRANS_OPT_LIST_OBJECTS_FILTER)) {
+               list_objects_filter_die_if_populated(&opts->filter_options);
                parse_list_objects_filter(&opts->filter_options, value);
                return 0;
        }
@@ -252,6 +253,14 @@ static int connect_setup(struct transport *transport, int for_push)
        return 0;
 }
 
+static void die_if_server_options(struct transport *transport)
+{
+       if (!transport->server_options || !transport->server_options->nr)
+               return;
+       advise(_("see protocol.version in 'git help config' for more details"));
+       die(_("server options require protocol version 2 or later"));
+}
+
 /*
  * Obtains the protocol version from the transport and writes it to
  * transport->data->version, first connecting if not already connected.
@@ -286,6 +295,7 @@ static struct ref *handshake(struct transport *transport, int for_push,
                break;
        case protocol_v1:
        case protocol_v0:
+               die_if_server_options(transport);
                get_remote_heads(&reader, &refs,
                                 for_push ? REF_NORMAL : 0,
                                 &data->extra_have,
@@ -362,6 +372,7 @@ static int fetch_refs_via_pack(struct transport *transport,
                break;
        case protocol_v1:
        case protocol_v0:
+               die_if_server_options(transport);
                refs = fetch_pack(&args, data->fd,
                                  refs_tmp ? refs_tmp : transport->remote_refs,
                                  to_fetch, nr_heads, &data->shallow,