Merge branch 'jc/maint-svn-info-test-fix'
[gitweb.git] / builtin / merge-recursive.c
index d8875d589240e0c78a9e241a7d2bdde1d10ab800..c33091b3ed52bc8539ff82f039ec8c7718f3dcc2 100644 (file)
@@ -2,6 +2,10 @@
 #include "commit.h"
 #include "tag.h"
 #include "merge-recursive.h"
+#include "xdiff-interface.h"
+
+static const char builtin_merge_recursive_usage[] =
+       "git %s <base>... -- <head> <remote> ...";
 
 static const char *better_branch_name(const char *branch)
 {
@@ -29,7 +33,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
                o.subtree_shift = "";
 
        if (argc < 4)
-               usagef("%s <base>... -- <head> <remote> ...", argv[0]);
+               usagef(builtin_merge_recursive_usage, argv[0]);
 
        for (i = 1; i < argc; ++i) {
                const char *arg = argv[i];
@@ -37,15 +41,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
                if (!prefixcmp(arg, "--")) {
                        if (!arg[2])
                                break;
-                       if (!strcmp(arg+2, "ours"))
-                               o.recursive_variant = MERGE_RECURSIVE_OURS;
-                       else if (!strcmp(arg+2, "theirs"))
-                               o.recursive_variant = MERGE_RECURSIVE_THEIRS;
-                       else if (!strcmp(arg+2, "subtree"))
-                               o.subtree_shift = "";
-                       else if (!prefixcmp(arg+2, "subtree="))
-                               o.subtree_shift = arg + 10;
-                       else
+                       if (parse_merge_opt(&o, arg + 2))
                                die("Unknown option %s", arg);
                        continue;
                }