Skip to content

Commit

Permalink
diffcore-rename: improve estimate_similarity() heuristics
Browse files Browse the repository at this point in the history
The logic to quickly dismiss potential rename pairs was broken.  It
would too eagerly dismiss possible renames when all of the difference
was due to pure new data (or deleted data).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Feb 19, 2011
1 parent 0940e5f commit 3a4d676
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diffcore-rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static int estimate_similarity(struct diff_filespec *src,
* and the final score computation below would not have a
* divide-by-zero issue.
*/
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
if (max_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
return 0;

if (!src->cnt_data && diff_populate_filespec(src, 0))
Expand Down

0 comments on commit 3a4d676

Please sign in to comment.