use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
[gitweb.git] / merge-recursive.c
index e5243c2b766881b5b4c83a16d9caebbd392c798a..d2b191b8c6832e2bfd27516ff549d47102510dff 100644 (file)
@@ -73,12 +73,9 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two,
 static struct commit *make_virtual_commit(struct tree *tree, const char *comment)
 {
        struct commit *commit = alloc_commit_node();
-       struct merge_remote_desc *desc = xmalloc(sizeof(*desc));
 
-       desc->name = comment;
-       desc->obj = (struct object *)commit;
+       set_merge_remote_desc(commit, comment, (struct object *)commit);
        commit->tree = tree;
-       commit->util = desc;
        commit->object.parsed = 1;
        return commit;
 }
@@ -209,7 +206,7 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
                        find_unique_abbrev(commit->object.oid.hash,
                                DEFAULT_ABBREV));
                if (parse_commit(commit) != 0)
-                       strbuf_addf(&o->obuf, _("(bad commit)\n"));
+                       strbuf_addstr(&o->obuf, _("(bad commit)\n"));
                else {
                        const char *title;
                        const char *msg = get_commit_buffer(commit, NULL);