summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-09-08 16:39:02 -0400
committerJames Moger <james.moger@gitblit.com>2014-09-08 16:39:02 -0400
commite58e09a9a944a7aeadf4f953ead9eca73403ac5c (patch)
tree3e04987ec2a8600dacb4666af3eee2e54ae3e09c /src
parentf0feb5138daf2abcf82563fdfcef5892219ef065 (diff)
downloadgitblit-e58e09a9a944a7aeadf4f953ead9eca73403ac5c.tar.gz
gitblit-e58e09a9a944a7aeadf4f953ead9eca73403ac5c.zip
Fix MigrateTickets failure for view-restricted repositories
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/MigrateTickets.java2
-rw-r--r--src/main/java/com/gitblit/manager/GitblitManager.java7
-rw-r--r--src/main/java/com/gitblit/manager/IRepositoryManager.java8
-rw-r--r--src/main/java/com/gitblit/manager/RepositoryManager.java21
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