Skip to content

Commit ee3d299

Browse files
author
Junio C Hamano
committed
diffcore-break/diffcore-rename: integer overflow.
While reviewing the end user tutorial rewrite by J. Bruce Fields, I noticed that "git-diff-tree -B -C" did not correctly break the total rewrite of Documentation/tutorial.txt. It turns out that we had integer overflow during the break score computations. Cop out by using floating point. This is not a kernel. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent a0dfb48 commit ee3d299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diffcore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* passed around in one int (high 16-bit for merge and low 16-bit
1616
* for break).
1717
*/
18-
#define MAX_SCORE 60000
18+
#define MAX_SCORE 60000.0
1919
#define DEFAULT_RENAME_SCORE 30000 /* rename/copy similarity minimum (50%) */
2020
#define DEFAULT_BREAK_SCORE 30000 /* minimum for break to happen (50%)*/
2121
#define DEFAULT_MERGE_SCORE 48000 /* maximum for break-merge to happen (80%)*/

0 commit comments

Comments
 (0)