]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/merge-tree.c
Merge branch 'js/merge-tree-3-trees'
[thirdparty/git.git] / builtin / merge-tree.c
index 60eaf0ca9f1af3f67a41bc1df96b2a58a04c6b91..8bdb439131499a57751ee87569028389dec82179 100644 (file)
@@ -13,7 +13,6 @@
 #include "parse-options.h"
 #include "repository.h"
 #include "blob.h"
-#include "exec-cmd.h"
 #include "merge-blobs.h"
 #include "quote.h"
 #include "tree.h"
@@ -477,8 +476,9 @@ static int real_merge(struct merge_tree_options *o,
                 * Get the merge bases, in reverse order; see comment above
                 * merge_incore_recursive in merge-ort.h
                 */
-               merge_bases = repo_get_merge_bases(the_repository, parent1,
-                                                  parent2);
+               if (repo_get_merge_bases(the_repository, parent1,
+                                        parent2, &merge_bases) < 0)
+                       exit(128);
                if (!merge_bases && !o->allow_unrelated_histories)
                        die(_("refusing to merge unrelated histories"));
                merge_bases = reverse_commit_list(merge_bases);
@@ -591,7 +591,8 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
                if (o.mode == MODE_TRIVIAL)
                        die(_("--trivial-merge is incompatible with all other options"));
                if (merge_base)
-                       die(_("--merge-base is incompatible with --stdin"));
+                       die(_("options '%s' and '%s' cannot be used together"),
+                           "--merge-base", "--stdin");
                line_termination = '\0';
                while (strbuf_getline_lf(&buf, stdin) != EOF) {
                        struct strbuf **split;