merge-recursive: expose merge options for builtin merge
There are two very similar blocks of code that recognize options for the "recursive" merge strategy. Unify them. No functional change intended. Cc: Avery Pennarun <apenwarr@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
7610fa57e6
commit
635a7bb1d8
@ -37,19 +37,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user