Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-21 23:18:23 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-21 23:21:24 +0300
commit9f70b806920e3ea158d7e189a1ec668445c13359 (patch)
tree0de8fc57e0e221f5588f895eb161faee5acc9e7d /diff.c
parent88b5a74883f146eac4b15b30e74bbdeb5ab5a63a (diff)
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 <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 0391e8c423..0f839c11b7 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.
*/