From 5e44bfa3ad462e1220426492c53606c6a643a970 Mon Sep 17 00:00:00 2001 From: Anton Khodos Date: Fri, 14 Jun 2019 17:16:15 +0200 Subject: Fix ApplyCommand which doesn't work if patch adds empty file Bug: 548219 Change-Id: Ibb32132a38e54508a24489322da58ddfd80a1d9a Signed-off-by: Anton Khodos Signed-off-by: Matthias Sohn --- .../tst/org/eclipse/jgit/api/ApplyCommandTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit') 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 @@ -110,6 +110,16 @@ public class ApplyCommandTest extends RepositoryTestCase { b.getString(0, b.size(), false)); } + @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); -- cgit v1.2.3