AbstractScmAccessor should apply logic from setBasedir. (#1471)
This commit is contained in:
committed by
Spencer Gibb
parent
707c496e4f
commit
3729648e5a
@@ -94,8 +94,8 @@ public abstract class AbstractScmAccessor implements ResourceLoaderAware {
|
||||
public AbstractScmAccessor(ConfigurableEnvironment environment,
|
||||
AbstractScmAccessorProperties properties) {
|
||||
this.environment = environment;
|
||||
this.basedir = properties.getBasedir() == null ? createBaseDir()
|
||||
: properties.getBasedir();
|
||||
this.setBasedir(properties.getBasedir() == null ? createBaseDir()
|
||||
: properties.getBasedir());
|
||||
this.passphrase = properties.getPassphrase();
|
||||
this.password = properties.getPassword();
|
||||
this.searchPaths = properties.getSearchPaths();
|
||||
|
||||
@@ -336,6 +336,18 @@ public class MultipleJGitEnvironmentRepositoryTests {
|
||||
this.repository.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exceptionNotThrownIfRelativeBasedirIsPassedByProperties()
|
||||
throws Exception {
|
||||
MultipleJGitEnvironmentProperties props = new MultipleJGitEnvironmentProperties();
|
||||
props.setBasedir(new File("relative"));
|
||||
this.repository = new MultipleJGitEnvironmentRepository(this.environment, props);
|
||||
String defaultUri = ConfigServerTestUtils.prepareLocalRepo("config-repo");
|
||||
this.repository.setUri(defaultUri);
|
||||
this.repository.setRepos(createRepositories());
|
||||
this.repository.afterPropertiesSet();
|
||||
}
|
||||
|
||||
private String getUri(String pattern) {
|
||||
String uri = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user