diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java index 0979db1e7..e57faaf85 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java @@ -43,6 +43,9 @@ package org.eclipse.jgit.diff; +import java.util.ArrayList; +import java.util.List; + /** * An extended form of Bram Cohen's patience diff algorithm. *
@@ -130,15 +133,14 @@ public class HistogramDiff extends LowLevelDiffAlgorithm {
public void diffNonCommon(EditList edits,
HashedSequenceComparator cmp, HashedSequence a,
HashedSequence b, Edit region) {
- new State(edits, cmp, a, b).diffReplace(region);
+ new State(edits, cmp, a, b).diffRegion(region);
}
private class State {
private final HashedSequenceComparator cmp;
-
private final HashedSequence a;
-
private final HashedSequence b;
+ private final List(maxChainLength, cmp, a, b, r)
.findLongestCommonSequence();
if (lcs != null) {
@@ -163,8 +171,8 @@ public class HistogramDiff extends LowLevelDiffAlgorithm {
//
edits.add(r);
} else {
- diff(r.before(lcs));
- diff(r.after(lcs));
+ queue.add(r.after(lcs));
+ queue.add(r.before(lcs));
}
} else if (fallback instanceof LowLevelDiffAlgorithm) {