|
27 | 27 | import java.io.FileOutputStream;
|
28 | 28 | import java.io.FileWriter;
|
29 | 29 | import java.io.IOException;
|
| 30 | +import java.net.URL; |
30 | 31 | import java.nio.charset.StandardCharsets;
|
31 | 32 | import java.nio.file.Files;
|
32 | 33 | import java.nio.file.Path;
|
@@ -125,22 +126,9 @@ void setUpClass() throws Exception {
|
125 | 126 | env.setAnnotationCacheEnabled(true);
|
126 | 127 |
|
127 | 128 | repository = new TestRepository();
|
128 |
| - repository.create(HistoryGuru.class.getResource("/repositories")); |
129 |
| - |
130 |
| - // After copying the files from the archive, Git will consider the files to be changed, |
131 |
| - // at least on Windows. This causes some tests, particularly testGetIndexDownArgs() to fail. |
132 |
| - // To avoid this, clone the Git repository. |
133 |
| - Path gitRepositoryRootPath = Path.of(repository.getSourceRoot(), "git"); |
134 |
| - Path gitCheckoutPath = Path.of(repository.getSourceRoot(), "gitcheckout"); |
135 |
| - Git git = Git.cloneRepository() |
136 |
| - .setURI(gitRepositoryRootPath.toFile().toURI().toString()) |
137 |
| - .setDirectory(gitCheckoutPath.toFile()) |
138 |
| - .call(); |
139 |
| - // The Git object has to be closed, otherwise the move below would fail on Windows with |
140 |
| - // AccessDeniedException due to the file handle still being open. |
141 |
| - git.close(); |
142 |
| - IOUtils.removeRecursive(gitRepositoryRootPath); |
143 |
| - Files.move(gitCheckoutPath, gitRepositoryRootPath); |
| 129 | + URL repositoryURL = HistoryGuru.class.getResource("/repositories"); |
| 130 | + assertNotNull(repositoryURL); |
| 131 | + repository.create(repositoryURL); |
144 | 132 |
|
145 | 133 | env.setSourceRoot(repository.getSourceRoot());
|
146 | 134 | env.setDataRoot(repository.getDataRoot());
|
|
0 commit comments