Merge branch 'rs/pull-signed-tag'

When "git merge-recursive" works on history with many criss-cross
merges in "verbose" mode, the names the command assigns to the
virtual merge bases could have overwritten each other by unintended
reuse of the same piece of memory.

* rs/pull-signed-tag:
  commit: use FLEX_ARRAY in struct merge_remote_desc
  merge-recursive: fix verbose output for multiple base trees
  commit: factor out set_merge_remote_desc()
  commit: use xstrdup() in get_merge_parent()
This commit is contained in:
Junio C Hamano
2016-08-19 15:34:13 -07:00
4 changed files with 33 additions and 12 deletions

View 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;
}