mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 13:35:44 +01:00
Cleanup usage of InitialRepositoryLocationResolver and RepositoryLocationResolver
This commit is contained in:
@@ -107,9 +107,14 @@ public class GitRepositoryHandler
|
||||
* @param repositoryLocationResolver
|
||||
*/
|
||||
@Inject
|
||||
public GitRepositoryHandler(ConfigurationStoreFactory storeFactory, FileSystem fileSystem, Scheduler scheduler, RepositoryLocationResolver repositoryLocationResolver, GitWorkdirFactory workdirFactory)
|
||||
public GitRepositoryHandler(ConfigurationStoreFactory storeFactory,
|
||||
FileSystem fileSystem,
|
||||
Scheduler scheduler,
|
||||
RepositoryLocationResolver repositoryLocationResolver,
|
||||
InitialRepositoryLocationResolver initialRepositoryLocationResolver,
|
||||
GitWorkdirFactory workdirFactory)
|
||||
{
|
||||
super(storeFactory, fileSystem, repositoryLocationResolver);
|
||||
super(storeFactory, fileSystem, repositoryLocationResolver, initialRepositoryLocationResolver);
|
||||
this.scheduler = scheduler;
|
||||
this.workdirFactory = workdirFactory;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
private GitWorkdirFactory gitWorkdirFactory;
|
||||
|
||||
RepositoryLocationResolver repositoryLocationResolver;
|
||||
private InitialRepositoryLocationResolver initialRepositoryLocationResolver;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -90,10 +91,10 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
File directory) {
|
||||
DefaultFileSystem fileSystem = new DefaultFileSystem();
|
||||
|
||||
InitialRepositoryLocationResolver initialRepositoryLocationResolver = new InitialRepositoryLocationResolver(contextProvider, fileSystem);
|
||||
initialRepositoryLocationResolver = new InitialRepositoryLocationResolver(contextProvider);
|
||||
repositoryLocationResolver = new RepositoryLocationResolver(repoDao, initialRepositoryLocationResolver);
|
||||
GitRepositoryHandler repositoryHandler = new GitRepositoryHandler(factory,
|
||||
fileSystem, scheduler, repositoryLocationResolver, gitWorkdirFactory);
|
||||
fileSystem, scheduler, repositoryLocationResolver, initialRepositoryLocationResolver, gitWorkdirFactory);
|
||||
repositoryHandler.init(contextProvider);
|
||||
|
||||
GitConfig config = new GitConfig();
|
||||
@@ -107,7 +108,7 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
@Test
|
||||
public void getDirectory() {
|
||||
GitRepositoryHandler repositoryHandler = new GitRepositoryHandler(factory,
|
||||
new DefaultFileSystem(), scheduler, repositoryLocationResolver, gitWorkdirFactory);
|
||||
new DefaultFileSystem(), scheduler, repositoryLocationResolver, initialRepositoryLocationResolver, gitWorkdirFactory);
|
||||
GitConfig config = new GitConfig();
|
||||
config.setDisabled(false);
|
||||
config.setGcExpression("gc exp");
|
||||
@@ -116,6 +117,6 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
|
||||
initRepository();
|
||||
File path = repositoryHandler.getDirectory(repository);
|
||||
assertEquals(repoPath.toString() + File.separator + InitialRepositoryLocationResolver.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath());
|
||||
assertEquals(repoPath.toString() + File.separator + RepositoryLocationResolver.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user