Skip to content

Commit

Permalink
string-list.[ch]: remove string_list_init() compatibility function
Browse files Browse the repository at this point in the history
Remove this function left over to accommodate in-flight changes, see
770feda (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
bc40dfb (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>
  • Loading branch information
avar authored and gitster committed Sep 28, 2021
1 parent cefe983 commit abf897b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,8 @@ int cmd_main(int argc, const char **argv)
options.verbosity = 1;
options.progress = !!isatty(2);
options.thin = 1;
string_list_init(&options.deepen_not, 1);
string_list_init(&options.push_options, 1);
string_list_init_dup(&options.deepen_not);
string_list_init_dup(&options.push_options);

/*
* Just report "remote-curl" here (folding all the various aliases
Expand Down
8 changes: 0 additions & 8 deletions string-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ void string_list_init_dup(struct string_list *list)
memcpy(list, &blank, sizeof(*list));
}

void string_list_init(struct string_list *list, int strdup_strings)
{
if (strdup_strings)
string_list_init_dup(list);
else
string_list_init_nodup(list);
}

/* if there is no exact match, point to the index where the entry could be
* inserted */
static int get_entry_index(const struct string_list *list, const char *string,
Expand Down
5 changes: 0 additions & 5 deletions string-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ struct string_list {
void string_list_init_nodup(struct string_list *list);
void string_list_init_dup(struct string_list *list);

/**
* TODO remove: For compatibility with any in-flight older API users
*/
void string_list_init(struct string_list *list, int strdup_strings);

/** Callback function type for for_each_string_list */
typedef int (*string_list_each_func_t)(struct string_list_item *, void *);

Expand Down

0 comments on commit abf897b

Please sign in to comment.