Code

string_list: Add STRING_LIST_INIT macro and make use of it.
[git.git] / builtin / fast-export.c
index c6dd71a7bcd0dfcb4691c9ca66a0c3a7bd4dcaae..834ec8b464d0ce5845a2312766554b60ed5d5d7e 100644 (file)
@@ -438,7 +438,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
                        /* handle nested tags */
                        while (tag && tag->object.type == OBJ_TAG) {
                                parse_object(tag->object.sha1);
-                               string_list_append(full_name, extra_refs)->util = tag;
+                               string_list_append(extra_refs, full_name)->util = tag;
                                tag = (struct tag *)tag->tagged;
                        }
                        if (!tag)
@@ -464,7 +464,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
                }
                if (commit->util)
                        /* more than one name for the same object */
-                       string_list_append(full_name, extra_refs)->util = commit;
+                       string_list_append(extra_refs, full_name)->util = commit;
                else
                        commit->util = full_name;
        }
@@ -566,7 +566,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 {
        struct rev_info revs;
        struct object_array commits = { 0, 0, NULL };
-       struct string_list extra_refs = { NULL, 0, 0, 0 };
+       struct string_list extra_refs = STRING_LIST_INIT_NODUP;
        struct commit *commit;
        char *export_filename = NULL, *import_filename = NULL;
        struct option options[] = {