summaryrefslogtreecommitdiff
path: root/merge-ort.c
diff options
context:
space:
mode:
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/merge-ort.c b/merge-ort.c
index 85942cfa7c..76c0f93427 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -168,12 +168,27 @@ struct conflict_info {
unsigned match_mask:3;
};
+static int err(struct merge_options *opt, const char *err, ...)
+{
+ va_list params;
+ struct strbuf sb = STRBUF_INIT;
+
+ strbuf_addstr(&sb, "error: ");
+ va_start(params, err);
+ strbuf_vaddf(&sb, err, params);
+ va_end(params);
+
+ error("%s", sb.buf);
+ strbuf_release(&sb);
+
+ return -1;
+}
+
static int collect_merge_info(struct merge_options *opt,
struct tree *merge_base,
struct tree *side1,
struct tree *side2)
{
- /* TODO: Implement this using traverse_trees() */
die("Not yet implemented.");
}
@@ -276,7 +291,19 @@ static void merge_ort_nonrecursive_internal(struct merge_options *opt,
{
struct object_id working_tree_oid;
- collect_merge_info(opt, merge_base, side1, side2);
+ if (collect_merge_info(opt, merge_base, side1, side2) != 0) {
+ /*
+ * TRANSLATORS: The %s arguments are: 1) tree hash of a merge
+ * base, and 2-3) the trees for the two trees we're merging.
+ */
+ err(opt, _("collecting merge info failed for trees %s, %s, %s"),
+ oid_to_hex(&merge_base->object.oid),
+ oid_to_hex(&side1->object.oid),
+ oid_to_hex(&side2->object.oid));
+ result->clean = -1;
+ return;
+ }
+
result->clean = detect_and_process_renames(opt, merge_base,
side1, side2);
process_entries(opt, &working_tree_oid);