]> source.dussan.org Git - jgit.git/commit
Fix ArrayIndexOutOfBounds on non-square exact rename matrix 60/1260/1
authorShawn O. Pearce <spearce@spearce.org>
Fri, 6 Aug 2010 16:33:55 +0000 (09:33 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 6 Aug 2010 16:39:10 +0000 (09:39 -0700)
commite2f5716c940c5da22cbb3b0b08cb4ee7f2970580
tree242c238e241dba2e3dfab21d50b0575d326caea4
parente64cb0306507ce8a33d5f638cb4aa0ec9c1327ff
Fix ArrayIndexOutOfBounds on non-square exact rename matrix

If the exact rename matrix for a particular ObjectId isn't square we
crashed with an ArrayIndexOutOfBoundsException because the matrix
entries were encoded backwards.  The encode function accepts the
source (aka deleted) index first, not second.  Add a unit test to
cover this non-square case to ensure we don't have this regression
in the future.

Change-Id: I5b005e5093e1f00de2e3ec104e27ab6820203566
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java