bundle: run setup_git_directory_gently() sooner
[gitweb.git] / builtin / fmt-merge-msg.c
index 44204257c72afd3a6a24966b9a11cf9f2374e9ce..bc3c5e6d3ec50eaa9829358ee0a82a1438c19f89 100644 (file)
@@ -82,7 +82,7 @@ static int handle_line(char *line)
 
        item = unsorted_string_list_lookup(&srcs, src);
        if (!item) {
-               item = string_list_append(src, &srcs);
+               item = string_list_append(&srcs, src);
                item->util = xcalloc(1, sizeof(struct src_data));
                init_src_data(item->util);
        }
@@ -93,19 +93,19 @@ static int handle_line(char *line)
                src_data->head_status |= 1;
        } else if (!prefixcmp(line, "branch ")) {
                origin = line + 7;
-               string_list_append(origin, &src_data->branch);
+               string_list_append(&src_data->branch, origin);
                src_data->head_status |= 2;
        } else if (!prefixcmp(line, "tag ")) {
                origin = line;
-               string_list_append(origin + 4, &src_data->tag);
+               string_list_append(&src_data->tag, origin + 4);
                src_data->head_status |= 2;
        } else if (!prefixcmp(line, "remote branch ")) {
                origin = line + 14;
-               string_list_append(origin, &src_data->r_branch);
+               string_list_append(&src_data->r_branch, origin);
                src_data->head_status |= 2;
        } else {
                origin = src;
-               string_list_append(line, &src_data->generic);
+               string_list_append(&src_data->generic, line);
                src_data->head_status |= 2;
        }
 
@@ -118,7 +118,7 @@ static int handle_line(char *line)
                sprintf(new_origin, "%s of %s", origin, src);
                origin = new_origin;
        }
-       string_list_append(origin, &origins)->util = sha1;
+       string_list_append(&origins, origin)->util = sha1;
        return 0;
 }
 
@@ -176,10 +176,10 @@ static void shortlog(const char *name, unsigned char *sha1,
                strbuf_ltrim(&sb);
 
                if (!sb.len)
-                       string_list_append(sha1_to_hex(commit->object.sha1),
-                                          &subjects);
+                       string_list_append(&subjects,
+                                          sha1_to_hex(commit->object.sha1));
                else
-                       string_list_append(strbuf_detach(&sb, NULL), &subjects);
+                       string_list_append(&subjects, strbuf_detach(&sb, NULL));
        }
 
        if (count > limit)