Skip to content

Commit 10ba05b

Browse files
author
Vladimir Kotal
committed
check equality
1 parent 123517d commit 10ba05b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/history/GitRepositoryTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,15 @@ private String addSubmodule(String submoduleName) throws Exception {
804804
org.eclipse.jgit.lib.Repository mainRepo = new FileRepositoryBuilder().
805805
setGitDir(Paths.get(repository.getSourceRoot(), "git", Constants.DOT_GIT).toFile())
806806
.build();
807+
String parent = newRepoFile.toPath().toUri().toString();
807808
try (Git git = new Git(mainRepo)) {
808809
git.submoduleAdd().
809-
setURI(newRepoFile.toPath().toUri().toString()).
810+
setURI(parent).
810811
setPath(submoduleName).
811812
call();
812813
}
813814

814-
return newRepoFile.toString();
815+
return parent;
815816
}
816817

817818
@Test
@@ -823,7 +824,7 @@ void testSubmodule() throws Exception {
823824
Repository subRepo = RepositoryFactory.getRepository(submodulePath.toFile());
824825
assertNotNull(subRepo);
825826
assertNotNull(subRepo.getParent());
826-
assertTrue(subRepo.getParent().contains(submoduleOriginPath));
827+
assertEquals(submoduleOriginPath, subRepo.getParent());
827828

828829
// Test relative path too. JGit always writes absolute path so overwrite the contents directly.
829830
File gitFile = Paths.get(submodulePath.toString(), Constants.DOT_GIT).toFile();

0 commit comments

Comments
 (0)