File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
opengrok-indexer/src/test/java/org/opengrok/indexer/history Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -804,14 +804,15 @@ private String addSubmodule(String submoduleName) throws Exception {
804
804
org .eclipse .jgit .lib .Repository mainRepo = new FileRepositoryBuilder ().
805
805
setGitDir (Paths .get (repository .getSourceRoot (), "git" , Constants .DOT_GIT ).toFile ())
806
806
.build ();
807
+ String parent = newRepoFile .toPath ().toUri ().toString ();
807
808
try (Git git = new Git (mainRepo )) {
808
809
git .submoduleAdd ().
809
- setURI (newRepoFile . toPath (). toUri (). toString () ).
810
+ setURI (parent ).
810
811
setPath (submoduleName ).
811
812
call ();
812
813
}
813
814
814
- return newRepoFile . toString () ;
815
+ return parent ;
815
816
}
816
817
817
818
@ Test
@@ -823,7 +824,7 @@ void testSubmodule() throws Exception {
823
824
Repository subRepo = RepositoryFactory .getRepository (submodulePath .toFile ());
824
825
assertNotNull (subRepo );
825
826
assertNotNull (subRepo .getParent ());
826
- assertTrue ( subRepo .getParent (). contains ( submoduleOriginPath ));
827
+ assertEquals ( submoduleOriginPath , subRepo .getParent ());
827
828
828
829
// Test relative path too. JGit always writes absolute path so overwrite the contents directly.
829
830
File gitFile = Paths .get (submodulePath .toString (), Constants .DOT_GIT ).toFile ();
You can’t perform that action at this time.
0 commit comments