From 9f70b806920e3ea158d7e189a1ec668445c13359 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 21 Nov 2005 12:18:23 -0800 Subject: rename detection with -M100 means "exact renames only". When the user is interested in pure renames, there is no point doing the similarity scores. This changes the score argument parsing to special case -M100 (otherwise, it is a precision scaled value 0 <= v < 1 and would mean 0.1, not 1.0 --- if you do mean 0.1, you can say -M1), and optimizes the diffcore_rename transformation to only look at pure renames in that case. Signed-off-by: Junio C Hamano --- diff.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 0391e8c42..0f839c11b 100644 --- a/diff.c +++ b/diff.c @@ -853,6 +853,10 @@ static int parse_num(const char **cp_p) } *cp_p = cp; + /* special case: -M100 would mean 1.0 not 0.1 */ + if (num == 100 && scale == 1000) + return MAX_SCORE; + /* user says num divided by scale and we say internally that * is MAX_SCORE * num / scale. */ -- cgit v1.2.1