summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/RpcServlet.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-10-31 22:47:21 -0400
committerJames Moger <james.moger@gitblit.com>2011-10-31 22:47:21 -0400
commit17820f3a1153250a325fed23dfc2da59ce6ba777 (patch)
treef4c990da15cac9cb71b5140ab093078c29b67f84 /src/com/gitblit/RpcServlet.java
parentac7f1753d3f742e0af8dd5e142b4eac9d9d2fbba (diff)
downloadgitblit-17820f3a1153250a325fed23dfc2da59ce6ba777.tar.gz
gitblit-17820f3a1153250a325fed23dfc2da59ce6ba777.zip
More feeds work in Manager
Diffstat (limited to 'src/com/gitblit/RpcServlet.java')
-rw-r--r--src/com/gitblit/RpcServlet.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/gitblit/RpcServlet.java b/src/com/gitblit/RpcServlet.java
index b068a39b..585770e8 100644
--- a/src/com/gitblit/RpcServlet.java
+++ b/src/com/gitblit/RpcServlet.java
@@ -91,28 +91,31 @@ public class RpcServlet extends JsonServlet {
}
result = repositories;
} else if (RpcRequest.LIST_BRANCHES.equals(reqType)) {
- // list all branches in all repositories accessible to user
- Map<String, List<String>> allBranches = new HashMap<String, List<String>>();
+ // list all local branches in all repositories accessible to user
+ Map<String, List<String>> localBranches = new HashMap<String, List<String>>();
List<RepositoryModel> models = GitBlit.self().getRepositoryModels(user);
for (RepositoryModel model : models) {
if (!model.hasCommits) {
// skip empty repository
continue;
}
- // get branches
+ // get local branches
Repository repository = GitBlit.self().getRepository(model.name);
List<RefModel> refs = JGitUtils.getLocalBranches(repository, false, -1);
- refs.addAll(JGitUtils.getRemoteBranches(repository, false, -1));
+ if (model.showRemoteBranches) {
+ // add remote branches if repository displays them
+ refs.addAll(JGitUtils.getRemoteBranches(repository, false, -1));
+ }
if (refs.size() > 0) {
List<String> branches = new ArrayList<String>();
for (RefModel ref : refs) {
branches.add(ref.getName());
}
- allBranches.put(model.name, branches);
+ localBranches.put(model.name, branches);
}
repository.close();
}
- result = allBranches;
+ result = localBranches;
} else if (RpcRequest.LIST_USERS.equals(reqType)) {
// list users
List<String> names = GitBlit.self().getAllUsernames();