aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst-rsrc
diff options
context:
space:
mode:
authorJon Schneider <jkschneider@gmail.com>2016-04-15 14:37:32 -0700
committerMatthias Sohn <matthias.sohn@sap.com>2016-04-16 17:28:06 -0500
commit80fa5f39f9d3b742e34b4baad019d917ff19f318 (patch)
treec5c31ed5e102de9c1f0efbac7147d8e4c5708237 /org.eclipse.jgit.test/tst-rsrc
parent24b6c080d74454bb2bc9d63490c24a51d8f5e259 (diff)
downloadjgit-80fa5f39f9d3b742e34b4baad019d917ff19f318.tar.gz
jgit-80fa5f39f9d3b742e34b4baad019d917ff19f318.zip
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>
Diffstat (limited to 'org.eclipse.jgit.test/tst-rsrc')
-rw-r--r--org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W.patch7
-rw-r--r--org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PostImage0
-rw-r--r--org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PreImage1
3 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W.patch
new file mode 100644
index 0000000000..cfecb8c5c4
--- /dev/null
+++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W.patch
@@ -0,0 +1,7 @@
+diff --git a/W b/W
+index a3648a1..2d44096 100644
+--- a/W
++++ b/W
+@@ -1 +0,0 @@
+-a
+\ No newline at end of file \ No newline at end of file
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PostImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PostImage
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PostImage
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PreImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PreImage
new file mode 100644
index 0000000000..2e65efe2a1
--- /dev/null
+++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/W_PreImage
@@ -0,0 +1 @@
+a \ No newline at end of file