string_list: Add STRING_LIST_INIT macro and make use of it.
Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
8a57c6e943
commit
183113a5ca
4
remote.c
4
remote.c
@ -754,7 +754,7 @@ int for_each_remote(each_remote_fn fn, void *priv)
|
||||
|
||||
void ref_remove_duplicates(struct ref *ref_map)
|
||||
{
|
||||
struct string_list refs = { NULL, 0, 0, 0 };
|
||||
struct string_list refs = STRING_LIST_INIT_NODUP;
|
||||
struct string_list_item *item = NULL;
|
||||
struct ref *prev = NULL, *next = NULL;
|
||||
for (; ref_map; prev = ref_map, ref_map = next) {
|
||||
@ -1704,7 +1704,7 @@ static int get_stale_heads_cb(const char *refname,
|
||||
struct ref *get_stale_heads(struct remote *remote, struct ref *fetch_map)
|
||||
{
|
||||
struct ref *ref, *stale_refs = NULL;
|
||||
struct string_list ref_names = { NULL, 0, 0, 0 };
|
||||
struct string_list ref_names = STRING_LIST_INIT_NODUP;
|
||||
struct stale_heads_info info;
|
||||
info.remote = remote;
|
||||
info.ref_names = &ref_names;
|
||||
|
Reference in New Issue
Block a user