Commit d8f9a1dd authored by Maxime Lefrançois's avatar Maxime Lefrançois

fetch first, then create :-)

parent e6165c95
......@@ -149,13 +149,7 @@ public class SourcesManager extends SAREFErrorLogger {
File repositoryDirectory = new File(sourcesDir, name);
Logger repositoryLogger = pipeline.getLogger(getMessage(MESSAGE.versions, name));
RepositoryFactory repositoryFactory = new RepositoryFactory(this, repositoryLogger, false);
SAREFRepository repository = repositoryFactory.create(repositoryDirectory);
if (repository == null) {
continue;
}
SAREFProject project = repository.getProject();
LOG.info("Fetch repository " + project);
LOG.info("Fetch repository " + name);
if (repositoryDirectory.isDirectory()) {
try (Git git = Git.open(repositoryDirectory)) {
git.fetch().setCredentialsProvider(credentialsProvider).setRemoveDeletedRefs(true).call();
......@@ -172,6 +166,12 @@ public class SourcesManager extends SAREFErrorLogger {
continue;
}
}
RepositoryFactory repositoryFactory = new RepositoryFactory(this, repositoryLogger, false);
SAREFRepository repository = repositoryFactory.create(repositoryDirectory);
if (repository == null) {
continue;
}
SAREFProject project = repository.getProject();
RepositoryManager repositoryManager = new RepositoryManager(pipeline, repositoryLogger, repository, false);
sourcesManagers.put(project, repositoryManager);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment