long start = System.nanoTime();
long totalTickets = 0;
long totalChanges = 0;
- for (RepositoryModel repository : repositoryManager.getRepositoryModels(null)) {
+ for (RepositoryModel repository : repositoryManager.getRepositoryModels()) {
Set<Long> ids = inputService.getIds(repository);
if (ids == null || ids.isEmpty()) {
// nothing to migrate
import com.gitblit.transport.ssh.IPublicKeyManager;
import com.gitblit.transport.ssh.SshKey;
import com.gitblit.utils.ArrayUtils;
-import com.gitblit.utils.XssFilter;
import com.gitblit.utils.HttpUtils;
import com.gitblit.utils.JsonUtils;
import com.gitblit.utils.ObjectCache;
import com.gitblit.utils.StringUtils;
+import com.gitblit.utils.XssFilter;
import com.google.gson.Gson;
import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;
return repositoryManager.getRepository(repositoryName, logError);
}
+ @Override
+ public List<RepositoryModel> getRepositoryModels() {
+ return repositoryManager.getRepositoryModels();
+ }
+
@Override
public List<RepositoryModel> getRepositoryModels(UserModel user) {
return repositoryManager.getRepositoryModels(user);
*/
Repository getRepository(String repositoryName, boolean logError);
+ /**
+ * Returns the list of all repository models.
+ *
+ * @return list of all repository models
+ * @since 1.6.1
+ */
+ List<RepositoryModel> getRepositoryModels();
+
/**
* Returns the list of repository models that are accessible to the user.
*
return r;
}
+ /**
+ * Returns the list of all repository models.
+ *
+ * @return list of all repository models
+ */
+ @Override
+ public List<RepositoryModel> getRepositoryModels() {
+ long methodStart = System.currentTimeMillis();
+ List<String> list = getRepositoryList();
+ List<RepositoryModel> repositories = new ArrayList<RepositoryModel>();
+ for (String repo : list) {
+ RepositoryModel model = getRepositoryModel(repo);
+ if (model != null) {
+ repositories.add(model);
+ }
+ }
+ long duration = System.currentTimeMillis() - methodStart;
+ logger.info(MessageFormat.format("{0} repository models loaded in {1} msecs", duration));
+ return repositories;
+ }
+
/**
* Returns the list of repository models that are accessible to the user.
*