string-list.[ch]: remove string_list_init() compatibility function

Remove this function left over to accommodate in-flight changes, see 770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(), 2021-07-01) for the recent change to add "string_list_init_{nodup,dup}()" initializers. There was only one user of the API left in remote-curl.c. I don't know why I didn't include this change to remote-curl.c in bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(), 2021-07-01), perhaps I just missed it. In any case, let's change that one user to use the new API, as of writing this there are no in-flight changes that use, so this seems like a good time to drop this before we get any new users of this compatibility API. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Sep 28, 2021 at 14:49 UTC abf897bacd2d36b9dbd07c70b4a2f97a084704ee
3 files changed +2 -15
remote-curl.c
+2 -2
@@ -1478,8 +1478,8 @@ int cmd_main(int argc, const char **argv)
1478 options.verbosity = 1;
1479 options.progress = !!isatty(2);
1480 options.thin = 1;
1481 - string_list_init(&options.deepen_not, 1);
1482 - string_list_init(&options.push_options, 1);
1481 + string_list_init_dup(&options.deepen_not);
1482 + string_list_init_dup(&options.push_options);
1483
1484 /*
1485 * Just report "remote-curl" here (folding all the various aliases
string-list.c
-8
@@ -13,14 +13,6 @@ void string_list_init_dup(struct string_list *list)
13 memcpy(list, &blank, sizeof(*list));
14 }
15
16 -void string_list_init(struct string_list *list, int strdup_strings)
17 -{
18 - if (strdup_strings)
19 - string_list_init_dup(list);
20 - else
21 - string_list_init_nodup(list);
22 -}
23 -
16 /* if there is no exact match, point to the index where the entry could be
17 * inserted */
18 static int get_entry_index(const struct string_list *list, const char *string,
string-list.h
-5
@@ -104,11 +104,6 @@ struct string_list {
104 void string_list_init_nodup(struct string_list *list);
105 void string_list_init_dup(struct string_list *list);
106
107 -/**
108 - * TODO remove: For compatibility with any in-flight older API users
109 - */
110 -void string_list_init(struct string_list *list, int strdup_strings);
111 -
107 /** Callback function type for for_each_string_list */
108 typedef int (*string_list_each_func_t)(struct string_list_item *, void *);
109