]> source.dussan.org Git - jgit.git/commit
Fix ApplyCommand when result of patch is an empty file 19/70819/1
authorJon Schneider <jkschneider@gmail.com>
Fri, 15 Apr 2016 21:37:32 +0000 (14:37 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 16 Apr 2016 22:28:06 +0000 (17:28 -0500)
commit80fa5f39f9d3b742e34b4baad019d917ff19f318
treec5c31ed5e102de9c1f0efbac7147d8e4c5708237
parent24b6c080d74454bb2bc9d63490c24a51d8f5e259
Fix ApplyCommand when result of patch is an empty file

Such hunks are identifiable by a zero value for "new start line". Prior
to the fix, JGit throws and ArrayIndexOutOfBoundsException on such
patches.

Change-Id: I4f3deb5e5f41a08af965fcc178d678c77270cddb
Signed-off-by: Jonathan Schneider <jkschneider@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W.patch [new file with mode: 0644]
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PostImage [new file with mode: 0644]
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PreImage [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java