Skip to content

Commit 3a4d676

Browse files
torvaldsgitster
authored andcommitted
diffcore-rename: improve estimate_similarity() heuristics
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0940e5f commit 3a4d676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diffcore-rename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static int estimate_similarity(struct diff_filespec *src,
170170
* and the final score computation below would not have a
171171
* divide-by-zero issue.
172172
*/
173-
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
173+
if (max_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
174174
return 0;
175175

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

0 commit comments

Comments
 (0)