summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org
diff options
context:
space:
mode:
authorJohn Dallaway <john@dallaway.org.uk>2020-09-02 14:15:23 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-10-25 22:24:17 +0100
commitf4b4dae2be1f6bb7e09a0c660e7fc8e093fb0617 (patch)
tree8f71b06b5a7f6da5e23581e2bd656d3ec479cdff /org.eclipse.jgit.test/tst/org
parent8269587f4927e3fc14624efcdd05427034782ee5 (diff)
downloadjgit-f4b4dae2be1f6bb7e09a0c660e7fc8e093fb0617.tar.gz
jgit-f4b4dae2be1f6bb7e09a0c660e7fc8e093fb0617.zip
Ensure .gitmodules is loaded when accessing submodule name
This problem occurred when calling SubmoduleWalk#getModuleName if the first submodule processed has a name and a path which do not match SubmoduleWalk#getModuleName returned the module path instead of the module name. In order to fix this SubmoduleWalk#getModuleName needs to ensure that the modules config is loaded. Bug: 565776 Change-Id: I36ce1fbc64c4849f9d8e39864b825c6e28d344f8 Signed-off-by: John Dallaway <john@dallaway.org.uk> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java1
1 files changed, 1 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 70175c8205..ea994f06aa 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
@@ -455,6 +455,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase {
final CanonicalTreeParser p = new CanonicalTreeParser();
p.reset(testDb.getRevWalk().getObjectReader(), commit.getTree());
try (SubmoduleWalk gen = SubmoduleWalk.forPath(db, p, "sub")) {
+ assertEquals(arbitraryName, gen.getModuleName());
assertEquals(path, gen.getPath());
assertEquals(subId, gen.getObjectId());
assertEquals(new File(db.getWorkTree(), path), gen.getDirectory());