summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-10-27 04:40:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-10-27 04:40:54 (GMT)
commit75b17fee72a0f78e0ad31728771231f8b3ed4d56 (patch)
tree190461ec1fedaf1a3c5d5d7fc9201a5a6455a144 /builtin
parent5a3a484d577d8612f729d64f3a069e63df07ec07 (diff)
parent4e5dd044c62f2a82de083e7cd46cad7b0d3465ae (diff)
downloadgit-75b17fee72a0f78e0ad31728771231f8b3ed4d56.zip
git-75b17fee72a0f78e0ad31728771231f8b3ed4d56.tar.gz
git-75b17fee72a0f78e0ad31728771231f8b3ed4d56.tar.bz2
Merge branch 'jf/merge-ignore-ws'
* jf/merge-ignore-ws: merge-recursive: options to ignore whitespace changes merge-recursive --patience ll-merge: replace flag argument with options struct merge-recursive: expose merge options for builtin merge
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c2
-rw-r--r--builtin/merge-recursive.c15
-rw-r--r--builtin/merge.c20
3 files changed, 5 insertions, 32 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index a54583b..9240faf 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -161,7 +161,7 @@ static int checkout_merged(int pos, struct checkout *state)
* merge.renormalize set, too
*/
status = ll_merge(&result_buf, path, &ancestor, "base",
- &ours, "ours", &theirs, "theirs", 0);
+ &ours, "ours", &theirs, "theirs", NULL);
free(ancestor.ptr);
free(ours.ptr);
free(theirs.ptr);
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index 78b9db7..c33091b 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -2,6 +2,7 @@
#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> ...";
@@ -40,19 +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 (!strcmp(arg+2, "renormalize"))
- o.renormalize = 1;
- else if (!strcmp(arg+2, "no-renormalize"))
- o.renormalize = 0;
- else
+ if (parse_merge_opt(&o, arg + 2))
die("Unknown option %s", arg);
continue;
}
diff --git a/builtin/merge.c b/builtin/merge.c
index 2dba3b9..10f091b 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -639,25 +639,9 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
o.renormalize = option_renormalize;
- /*
- * NEEDSWORK: merge with table in builtin/merge-recursive
- */
- for (x = 0; x < xopts_nr; x++) {
- if (!strcmp(xopts[x], "ours"))
- o.recursive_variant = MERGE_RECURSIVE_OURS;
- else if (!strcmp(xopts[x], "theirs"))
- o.recursive_variant = MERGE_RECURSIVE_THEIRS;
- else if (!strcmp(xopts[x], "subtree"))
- o.subtree_shift = "";
- else if (!prefixcmp(xopts[x], "subtree="))
- o.subtree_shift = xopts[x]+8;
- else if (!strcmp(xopts[x], "renormalize"))
- o.renormalize = 1;
- else if (!strcmp(xopts[x], "no-renormalize"))
- o.renormalize = 0;
- else
+ for (x = 0; x < xopts_nr; x++)
+ if (parse_merge_opt(&o, xopts[x]))
die("Unknown option for merge-recursive: -X%s", xopts[x]);
- }
o.branch1 = head_arg;
o.branch2 = remoteheads->item->util;