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:
Thiago Farina
2010-07-04 16:46:19 -03:00
committed by Junio C Hamano
parent 8a57c6e943
commit 183113a5ca
16 changed files with 36 additions and 31 deletions

View File

@ -548,8 +548,8 @@ static void find_non_local_tags(struct transport *transport,
struct ref **head,
struct ref ***tail)
{
struct string_list existing_refs = { NULL, 0, 0, 0 };
struct string_list remote_refs = { NULL, 0, 0, 0 };
struct string_list existing_refs = STRING_LIST_INIT_NODUP;
struct string_list remote_refs = STRING_LIST_INIT_NODUP;
const struct ref *ref;
struct string_list_item *item = NULL;
@ -651,7 +651,7 @@ static int truncate_fetch_head(void)
static int do_fetch(struct transport *transport,
struct refspec *refs, int ref_count)
{
struct string_list existing_refs = { NULL, 0, 0, 0 };
struct string_list existing_refs = STRING_LIST_INIT_NODUP;
struct string_list_item *peer_item = NULL;
struct ref *ref_map;
struct ref *rm;
@ -874,7 +874,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
int cmd_fetch(int argc, const char **argv, const char *prefix)
{
int i;
struct string_list list = { NULL, 0, 0, 0 };
struct string_list list = STRING_LIST_INIT_NODUP;
struct remote *remote;
int result = 0;