]> git.ipfire.org Git - thirdparty/git.git/blobdiff - transport.c
refs: unify parse_worktree_ref() and ref_type()
[thirdparty/git.git] / transport.c
index 52db7a3cb09fa6129e399c82f404a574884053b3..1687ad7e2c66c23b6c488ac7d82117828d23dfc9 100644 (file)
@@ -142,7 +142,7 @@ static void get_refs_from_bundle_inner(struct transport *transport)
 
 static struct ref *get_refs_from_bundle(struct transport *transport,
                                        int for_push,
-                                       struct transport_ls_refs_options *transport_options)
+                                       struct transport_ls_refs_options *transport_options UNUSED)
 {
        struct bundle_transport_data *data = transport->data;
        struct ref *result = NULL;
@@ -386,7 +386,8 @@ static int fetch_refs_via_pack(struct transport *transport,
        args.cloning = transport->cloning;
        args.update_shallow = data->options.update_shallow;
        args.from_promisor = data->options.from_promisor;
-       args.filter_options = data->options.filter_options;
+       list_objects_filter_copy(&args.filter_options,
+                                &data->options.filter_options);
        args.refetch = data->options.refetch;
        args.stateless_rpc = transport->stateless_rpc;
        args.server_options = transport->server_options;
@@ -453,6 +454,7 @@ cleanup:
 
        free_refs(refs_tmp);
        free_refs(refs);
+       list_objects_filter_release(&args.filter_options);
        return ret;
 }
 
@@ -893,6 +895,7 @@ static int disconnect_git(struct transport *transport)
                finish_connect(data->conn);
        }
 
+       list_objects_filter_release(&data->options.filter_options);
        free(data);
        return 0;
 }
@@ -940,7 +943,7 @@ static int external_specification_len(const char *url)
        return strchr(url, ':') - url;
 }
 
-static const struct string_list *protocol_whitelist(void)
+static const struct string_list *protocol_allow_list(void)
 {
        static int enabled = -1;
        static struct string_list allowed = STRING_LIST_INIT_DUP;
@@ -1020,9 +1023,9 @@ static enum protocol_allow_config get_protocol_config(const char *type)
 
 int is_transport_allowed(const char *type, int from_user)
 {
-       const struct string_list *whitelist = protocol_whitelist();
-       if (whitelist)
-               return string_list_has_string(whitelist, type);
+       const struct string_list *allow_list = protocol_allow_list();
+       if (allow_list)
+               return string_list_has_string(allow_list, type);
 
        switch (get_protocol_config(type)) {
        case PROTOCOL_ALLOW_ALWAYS: