diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 17ada88dfb9543ba782b84507b451fabfec28e10..be9b512eebc72984e6ff4cdd4859ab7951539e19 100644 (file)
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
static int add_existing(const char *refname, const unsigned char *sha1, int flag, void *cbdata)
{
struct string_list *list = (struct string_list *)cbdata;
static int add_existing(const char *refname, const unsigned char *sha1, int flag, void *cbdata)
{
struct string_list *list = (struct string_list *)cbdata;
- string_list_insert(refname, list);
+ string_list_insert(list, refname);
return 0;
}
return 0;
}
@@ -120,7 +120,7 @@ static int add_existing(const char *refname, const unsigned char *sha1, int flag
*/
static int exclude_existing(const char *match)
{
*/
static int exclude_existing(const char *match)
{
- static struct string_list existing_refs = { NULL, 0, 0, 0 };
+ static struct string_list existing_refs = STRING_LIST_INIT_NODUP;
char buf[1024];
int matchlen = match ? strlen(match) : 0;
char buf[1024];
int matchlen = match ? strlen(match) : 0;