summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
commit69307312d1bee69d33151cee8ed5940c46d7ee39 (patch)
tree8c7ed3be35ac5d44c394c8e1aa2234265464849e /merge-recursive.c
parentMerge branch 'js/test-lint-pathname' into maint (diff)
parentcommit: use FLEX_ARRAY in struct merge_remote_desc (diff)
downloadtgif-69307312d1bee69d33151cee8ed5940c46d7ee39.tar.xz
Merge branch 'rs/pull-signed-tag' into maint
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()
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 9748bafd30..e7178bcdcc 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -42,12 +42,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;
}