summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-merge-file.c4
-rw-r--r--xdiff/xmerge.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index 5b4f020e38..1e92510026 100644
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
@@ -27,10 +27,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
else if (!strcmp(argv[1], "-q") ||
!strcmp(argv[1], "--quiet"))
freopen("/dev/null", "w", stderr);
- else if (!strcmp(argv[1], "--diff3")) {
+ else if (!strcmp(argv[1], "--diff3"))
merge_style = XDL_MERGE_DIFF3;
- merge_level = XDL_MERGE_EAGER;
- }
else
usage(merge_file_usage);
argc--;
diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
index 7dcd4055ae..d9737f04c2 100644
--- a/xdiff/xmerge.c
+++ b/xdiff/xmerge.c
@@ -392,6 +392,15 @@ static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
int level = flags & XDL_MERGE_LEVEL_MASK;
int style = flags & XDL_MERGE_STYLE_MASK;
+ if (style == XDL_MERGE_DIFF3) {
+ /*
+ * "diff3 -m" output does not make sense for anything
+ * more aggressive than XDL_MERGE_EAGER.
+ */
+ if (XDL_MERGE_EAGER < level)
+ level = XDL_MERGE_EAGER;
+ }
+
c = changes = NULL;
while (xscr1 && xscr2) {