summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-21 00:18:27 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-24 23:50:44 -0700
commit8082d8d3050e3fdd7b0f13c7a7b3ad68af7f478a (patch)
tree6939780586028325f91f5193c56ba42eafef179c /diffcore-rename.c
parent6b5ee137e56af8093391411389dd4b18416707ec (diff)
downloadgit-8082d8d3050e3fdd7b0f13c7a7b3ad68af7f478a.tar.gz
Diff: -l<num> to limit rename/copy detection.
When many paths are modified, rename detection takes a lot of time. The new option -l<num> can be used to disable rename detection when more than <num> paths are possibly created as renames. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c8
1 files changed, 6 insertions, 2 deletions
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