aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorAnton Khodos <khodosanton@gmail.com>2019-06-14 17:16:15 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-08-19 02:37:04 +0200
commit5e44bfa3ad462e1220426492c53606c6a643a970 (patch)
tree003ec4c56e4fdab69b2e4840b6357dabecf2f1d7 /org.eclipse.jgit.test/tst/org/eclipse/jgit
parent8c7f1a699a65738220dd08a130295804cad32a32 (diff)
downloadjgit-5e44bfa3ad462e1220426492c53606c6a643a970.tar.gz
jgit-5e44bfa3ad462e1220426492c53606c6a643a970.zip
Fix ApplyCommand which doesn't work if patch adds empty file
Bug: 548219 Change-Id: Ibb32132a38e54508a24489322da58ddfd80a1d9a Signed-off-by: Anton Khodos <khodosanton@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
index 1dd329a9e7..714a54c90c 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
@@ -111,6 +111,16 @@ public class ApplyCommandTest extends RepositoryTestCase {
}
@Test
+ public void testAddA3() throws Exception {
+ ApplyResult result = init("A3", false, true);
+ assertEquals(1, result.getUpdatedFiles().size());
+ assertEquals(new File(db.getWorkTree(), "A3"),
+ result.getUpdatedFiles().get(0));
+ checkFile(new File(db.getWorkTree(), "A3"),
+ b.getString(0, b.size(), false));
+ }
+
+ @Test
public void testAddA1Sub() throws Exception {
ApplyResult result = init("A1_sub", false, false);
assertEquals(1, result.getUpdatedFiles().size());