test-lib: introduce test_commit_bulk
[gitweb.git] / merge-recursive.c
index 36af441faa0b562222853c27128b5a23de99e551..d2e380b7ed845e6fb2cd5616754a3f12a11c7b18 100644 (file)
@@ -163,6 +163,11 @@ static struct tree *shift_tree_object(struct repository *repo,
        return lookup_tree(repo, &shifted);
 }
 
+static inline void set_commit_tree(struct commit *c, struct tree *t)
+{
+       c->maybe_tree = t;
+}
+
 static struct commit *make_virtual_commit(struct repository *repo,
                                          struct tree *tree,
                                          const char *comment)
@@ -170,7 +175,7 @@ static struct commit *make_virtual_commit(struct repository *repo,
        struct commit *commit = alloc_commit_node(repo);
 
        set_merge_remote_desc(commit, comment, (struct object *)commit);
-       commit->maybe_tree = tree;
+       set_commit_tree(commit, tree);
        commit->object.parsed = 1;
        return commit;
 }
@@ -1076,7 +1081,7 @@ static int find_first_merges(struct repository *repo,
        struct commit *commit;
        int contains_another;
 
-       char merged_revision[42];
+       char merged_revision[GIT_MAX_HEXSZ + 2];
        const char *rev_args[] = { "rev-list", "--merges", "--ancestry-path",
                                   "--all", merged_revision, NULL };
        struct rev_info revs;
@@ -1655,6 +1660,7 @@ static int handle_rename_add(struct merge_options *opt,
               c->path, add_branch);
 
        prev_path_desc = xstrfmt("version of %s from %s", path, a->path);
+       ci->ren1->src_entry->stages[other_stage].path = a->path;
        if (merge_mode_and_contents(opt, a, c,
                                    &ci->ren1->src_entry->stages[other_stage],
                                    prev_path_desc,