diff --git a/opengrok-indexer/pom.xml b/opengrok-indexer/pom.xml index c704d952d61..697f422b8ae 100644 --- a/opengrok-indexer/pom.xml +++ b/opengrok-indexer/pom.xml @@ -18,7 +18,7 @@ information: Portions Copyright [yyyy] [name of copyright owner] CDDL HEADER END -Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. Portions Copyright (c) 2017-2020, Chris Fraire . Portions Copyright (c) 2020-2020, Lubos Kosco . @@ -237,7 +237,7 @@ Portions Copyright (c) 2020-2020, Lubos Kosco . org.eclipse.jgit org.eclipse.jgit - 6.6.1.202309021850-r + 7.2.1.202505142326-r io.github.g00fy2 diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java index 269efea9dfb..7c938243cb5 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java @@ -27,6 +27,7 @@ import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; +import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -125,22 +126,9 @@ void setUpClass() throws Exception { env.setAnnotationCacheEnabled(true); repository = new TestRepository(); - repository.create(HistoryGuru.class.getResource("/repositories")); - - // After copying the files from the archive, Git will consider the files to be changed, - // at least on Windows. This causes some tests, particularly testGetIndexDownArgs() to fail. - // To avoid this, clone the Git repository. - Path gitRepositoryRootPath = Path.of(repository.getSourceRoot(), "git"); - Path gitCheckoutPath = Path.of(repository.getSourceRoot(), "gitcheckout"); - Git git = Git.cloneRepository() - .setURI(gitRepositoryRootPath.toFile().toURI().toString()) - .setDirectory(gitCheckoutPath.toFile()) - .call(); - // The Git object has to be closed, otherwise the move below would fail on Windows with - // AccessDeniedException due to the file handle still being open. - git.close(); - IOUtils.removeRecursive(gitRepositoryRootPath); - Files.move(gitCheckoutPath, gitRepositoryRootPath); + URL repositoryURL = HistoryGuru.class.getResource("/repositories"); + assertNotNull(repositoryURL); + repository.create(repositoryURL); env.setSourceRoot(repository.getSourceRoot()); env.setDataRoot(repository.getDataRoot());