From 8082d8d3050e3fdd7b0f13c7a7b3ad68af7f478a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 21 Sep 2005 00:18:27 -0700 Subject: Diff: -l to limit rename/copy detection. When many paths are modified, rename detection takes a lot of time. The new option -l can be used to disable rename detection when more than paths are possibly created as renames. Signed-off-by: Junio C Hamano --- diffcore-rename.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'diffcore-rename.c') diff --git a/diffcore-rename.c b/diffcore-rename.c index 092cf68de6..e17dd90058 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -249,8 +249,11 @@ static int compute_stays(struct diff_queue_struct *q, return 1; } -void diffcore_rename(int detect_rename, int minimum_score) +void diffcore_rename(struct diff_options *options) { + int detect_rename = options->detect_rename; + int minimum_score = options->rename_score; + int rename_limit = options->rename_limit; struct diff_queue_struct *q = &diff_queued_diff; struct diff_queue_struct outq; struct diff_score *mx; @@ -279,7 +282,8 @@ void diffcore_rename(int detect_rename, int minimum_score) else if (detect_rename == DIFF_DETECT_COPY) register_rename_src(p->one, 1); } - if (rename_dst_nr == 0) + if (rename_dst_nr == 0 || + (0 <= rename_limit && rename_limit < rename_dst_nr)) goto cleanup; /* nothing to do */ /* We really want to cull the candidates list early -- cgit v1.2.1