Skip to content

Commit f6552af

Browse files
committed
do not disturb the original repository
1 parent 885d0de commit f6552af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ void testBuildTagListInitial() throws Exception {
478478

479479
@Test
480480
void testBuildTagListOneMore() throws Exception {
481+
Path repositoryRootPath = Files.createDirectory(Path.of(RuntimeEnvironment.getInstance().getSourceRootPath(),
482+
"addedTagTest"));
483+
File repositoryRoot = repositoryRootPath.toFile();
484+
runHgCommand(this.repositoryRoot, "clone", this.repositoryRoot.toString(), repositoryRootPath.toString());
481485
MercurialRepository hgRepo = (MercurialRepository) RepositoryFactory.getRepository(repositoryRoot);
482486
assertNotNull(hgRepo);
483487
runHgCommand(repositoryRoot, "tag", "foo");
@@ -488,5 +492,6 @@ void testBuildTagListOneMore() throws Exception {
488492
Set<TagEntry> expectedTags = Set.of(new MercurialTagEntry(7, "start_of_novel"),
489493
new MercurialTagEntry(9, "foo"));
490494
assertEquals(expectedTags, tags);
495+
IOUtils.removeRecursive(repositoryRootPath);
491496
}
492497
}

0 commit comments

Comments
 (0)