diff options
Diffstat (limited to 'src')
4 files changed, 36 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/MigrateTickets.java b/src/main/java/com/gitblit/MigrateTickets.java index 94284ee2..b08228ef 100644 --- a/src/main/java/com/gitblit/MigrateTickets.java +++ b/src/main/java/com/gitblit/MigrateTickets.java @@ -170,7 +170,7 @@ public class MigrateTickets { 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 diff --git a/src/main/java/com/gitblit/manager/GitblitManager.java b/src/main/java/com/gitblit/manager/GitblitManager.java index 2ed52d67..08853a66 100644 --- a/src/main/java/com/gitblit/manager/GitblitManager.java +++ b/src/main/java/com/gitblit/manager/GitblitManager.java @@ -79,11 +79,11 @@ import com.gitblit.tickets.ITicketService; 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; @@ -982,6 +982,11 @@ public class GitblitManager implements IGitblit { } @Override + public List<RepositoryModel> getRepositoryModels() { + return repositoryManager.getRepositoryModels(); + } + + @Override public List<RepositoryModel> getRepositoryModels(UserModel user) { return repositoryManager.getRepositoryModels(user); } diff --git a/src/main/java/com/gitblit/manager/IRepositoryManager.java b/src/main/java/com/gitblit/manager/IRepositoryManager.java index f5cf03fa..f37612d3 100644 --- a/src/main/java/com/gitblit/manager/IRepositoryManager.java +++ b/src/main/java/com/gitblit/manager/IRepositoryManager.java @@ -195,6 +195,14 @@ public interface IRepositoryManager extends IManager { 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. * * @param user diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index ac9ea156..99441309 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -625,6 +625,27 @@ public class RepositoryManager implements IRepositoryManager { } /** + * 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. * * @param user |