diff options
Diffstat (limited to 'builtin/merge-recursive.c')
-rw-r--r-- | builtin/merge-recursive.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c index 3366699657..1dd295558b 100644 --- a/builtin/merge-recursive.c +++ b/builtin/merge-recursive.c @@ -1,13 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "advice.h" -#include "commit.h" #include "gettext.h" #include "hash.h" -#include "tag.h" #include "merge-recursive.h" #include "object-name.h" -#include "repository.h" -#include "xdiff-interface.h" static const char builtin_merge_recursive_usage[] = "git %s <base>... -- <head> <remote> ..."; @@ -24,9 +21,12 @@ static char *better_branch_name(const char *branch) return xstrdup(name ? name : branch); } -int cmd_merge_recursive(int argc, const char **argv, const char *prefix UNUSED) +int cmd_merge_recursive(int argc, + const char **argv, + const char *prefix UNUSED, + struct repository *repo UNUSED) { - const struct object_id *bases[21]; + struct object_id bases[21]; unsigned bases_count = 0; int i, failed; struct object_id h1, h2; @@ -34,7 +34,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix UNUSED) char *better1, *better2; struct commit *result; - init_merge_options(&o, the_repository); + init_basic_merge_options(&o, the_repository); if (argv[0] && ends_with(argv[0], "-subtree")) o.subtree_shift = ""; @@ -52,10 +52,8 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix UNUSED) continue; } if (bases_count < ARRAY_SIZE(bases)-1) { - struct object_id *oid = xmalloc(sizeof(struct object_id)); - if (repo_get_oid(the_repository, argv[i], oid)) + if (repo_get_oid(the_repository, argv[i], &bases[bases_count++])) die(_("could not parse object '%s'"), argv[i]); - bases[bases_count++] = oid; } else warning(Q_("cannot handle more than %d base. " |