diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java index d6026b5be..f4cccfc37 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java @@ -144,6 +144,8 @@ class SimilarityIndex { int score(SimilarityIndex dst) { long max = Math.max(fileSize, dst.fileSize); + if (max == 0) + return 100; return (int) ((common(dst) * 100L) / max); }