aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2010-09-27 16:58:25 -0700
committerJunio C Hamano <gitster@pobox.com>2010-09-29 13:15:56 -0700
commit10ae7526bebb505ddddba01f76ec97d5f7b5e0e5 (patch)
tree9f51a2c9fabad753a2840f4d33023bed3c8d19c9 /merge-recursive.c
parent4e5dd044c62f2a82de083e7cd46cad7b0d3465ae (diff)
downloadgit-10ae7526bebb505ddddba01f76ec97d5f7b5e0e5.tar.gz
git-10ae7526bebb505ddddba01f76ec97d5f7b5e0e5.tar.xz
merge-recursive: option to specify rename threshold
The recursive merge strategy turns on rename detection but leaves the rename threshold at the default. Add a strategy option to allow the user to specify a rename threshold to use. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 9b9f97e6a..148c550fe 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -339,6 +339,7 @@ static struct string_list *get_renames(struct merge_options *o,
opts.rename_limit = o->merge_rename_limit >= 0 ? o->merge_rename_limit :
o->diff_rename_limit >= 0 ? o->diff_rename_limit :
500;
+ opts.rename_score = o->rename_score;
opts.warn_on_too_large_rename = 1;
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
if (diff_setup_done(&opts) < 0)
@@ -1525,6 +1526,11 @@ int parse_merge_opt(struct merge_options *o, const char *s)
o->renormalize = 1;
else if (!strcmp(s, "no-renormalize"))
o->renormalize = 0;
+ else if (!prefixcmp(s, "rename-threshold=")) {
+ const char *score = s + strlen("rename-threshold=");
+ if ((o->rename_score = parse_rename_score(&score)) == -1 || *score != 0)
+ return -1;
+ }
else
return -1;
return 0;