summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2020-12-30 03:05:00 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2020-12-30 03:05:00 -0500
commit086f474054440579dece78aa3a12a3157c80b344 (patch)
tree659124e4537e89b7fb7424bcc2537d072d989c7d /org.eclipse.jgit.test
parent8caaaf956a070864b8e700afc76b5ab9e8c12f36 (diff)
parentaa3a1ecd133628c4d9d211d2b227f96b5c3d9d8f (diff)
downloadjgit-086f474054440579dece78aa3a12a3157c80b344.tar.gz
jgit-086f474054440579dece78aa3a12a3157c80b344.zip
Merge "Added check for null on DirCacheEntry in checkoutEntry method"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index b943486b1b..9dfceae345 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -13,6 +13,7 @@
package org.eclipse.jgit.lib;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -47,6 +48,7 @@ import org.eclipse.jgit.errors.CorruptObjectException;
import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.events.ChangeRecorder;
import org.eclipse.jgit.events.ListenerHandle;
+import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.junit.TestRepository.BranchBuilder;
@@ -2146,4 +2148,11 @@ public class DirCacheCheckoutTest extends RepositoryTestCase {
assertEquals("WorkDir has not the right size.", i.size(), nrFiles);
}
}
+
+ @Test
+ public void shouldReturnAndNotThrowNPEWhenCheckoutEntryIsCalledWithNullEntry() throws Exception{
+ checkoutEntry(new InMemoryRepository(null), null, null, true, new CheckoutMetadata(null, null));
+ }
+
+
}