From 17820f3a1153250a325fed23dfc2da59ce6ba777 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 31 Oct 2011 22:47:21 -0400
Subject: [PATCH] More feeds work in Manager
---
src/com/gitblit/RpcServlet.java | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/com/gitblit/RpcServlet.java b/src/com/gitblit/RpcServlet.java
index b068a39..585770e 100644
--- a/src/com/gitblit/RpcServlet.java
+++ b/src/com/gitblit/RpcServlet.java
@@ -91,28 +91,31 @@
}
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();
--
Gitblit v1.9.1