X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=merge-recursive.c;h=d83cd6c662847fb51641d7b8bf16739e588f67a2;hb=ed6ce4382b5cb34e98ca3db2f19de82a037da322;hp=cc664c39b66b0bb499dec13a22880a6096423fa6;hpb=4a242d6cb72d0a3b0216b4de67793d80e17f6968;p=git.git diff --git a/merge-recursive.c b/merge-recursive.c index cc664c39b..d83cd6c66 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -38,16 +38,15 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two, return lookup_tree(shifted); } -/* - * A virtual commit has (const char *)commit->util set to the name. - */ - static struct commit *make_virtual_commit(struct tree *tree, const char *comment) { struct commit *commit = xcalloc(1, sizeof(struct commit)); + struct merge_remote_desc *desc = xmalloc(sizeof(*desc)); + + desc->name = comment; + desc->obj = (struct object *)commit; commit->tree = tree; - commit->util = (void*)comment; - /* avoid warnings */ + commit->util = desc; commit->object.parsed = 1; return commit; } @@ -184,7 +183,7 @@ static void output_commit_title(struct merge_options *o, struct commit *commit) for (i = o->call_depth; i--;) fputs(" ", stdout); if (commit->util) - printf("virtual %s\n", (char *)commit->util); + printf("virtual %s\n", merge_remote_util(commit)->name); else { printf("%s ", find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV)); if (parse_commit(commit) != 0) @@ -265,7 +264,7 @@ struct tree *write_tree_from_memory(struct merge_options *o) if (!cache_tree_fully_valid(active_cache_tree) && cache_tree_update(active_cache_tree, - active_cache, active_nr, 0, 0) < 0) + active_cache, active_nr, 0, 0, 0) < 0) die("error building trees"); result = lookup_tree(active_cache_tree->sha1);