aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-08-01 17:03:11 +0200
committerAndrey Loskutov <loskutov@gmx.de>2015-08-03 07:58:52 -0400
commita28ae3995fc4655be1400cf694e4b0d97db5df45 (patch)
treebfeb340b8d478953f6dcd7b6f2d0dc64818cdb4a /org.eclipse.jgit.test/tst/org
parent204da3969e51d0e36b59924d697787ae9578332e (diff)
downloadjgit-a28ae3995fc4655be1400cf694e4b0d97db5df45.tar.gz
jgit-a28ae3995fc4655be1400cf694e4b0d97db5df45.zip
containsGitModulesFile() should not crash on bare repository
Change-Id: Iba7e4674b3d33c730613a6ac703977f48b015853 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java
index f7acaa7880..72b4611df5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java
@@ -65,6 +65,7 @@ import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.errors.NoWorkTreeException;
+import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.Config;
@@ -101,6 +102,13 @@ public class SubmoduleWalkTest extends RepositoryTestCase {
}
@Test
+ public void bareRepositoryWithNoSubmodules() throws IOException {
+ FileRepository bareRepo = createBareRepository();
+ boolean result = SubmoduleWalk.containsGitModulesFile(bareRepo);
+ assertFalse(result);
+ }
+
+ @Test
public void repositoryWithRootLevelSubmodule() throws IOException,
ConfigInvalidException, NoWorkTreeException, GitAPIException {
final ObjectId id = ObjectId