summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/servlet/RpcServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/servlet/RpcServlet.java')
-rw-r--r--src/main/java/com/gitblit/servlet/RpcServlet.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/servlet/RpcServlet.java b/src/main/java/com/gitblit/servlet/RpcServlet.java
index 9809a252..025be440 100644
--- a/src/main/java/com/gitblit/servlet/RpcServlet.java
+++ b/src/main/java/com/gitblit/servlet/RpcServlet.java
@@ -328,6 +328,18 @@ public class RpcServlet extends JsonServlet {
Collection<RegistrantAccessPermission> permissions = deserialize(request, response,
RpcUtils.REGISTRANT_PERMISSIONS_TYPE);
result = gitblit.setTeamAccessPermissions(model, permissions);
+ } else if (RpcRequest.LIST_REPOSITORY_BRANCHES.equals(reqType)) {
+
+ // list all branches for the given repository
+ Repository repository = gitblit.getRepository(objectName);
+ List<RefModel> refs = JGitUtils.getLocalBranches(repository, false, -1);
+
+ List<String> branches = new ArrayList<>();
+ for (RefModel ref : refs) {
+ branches.add(ref.getName());
+ }
+ repository.close();
+ result = branches;
} else if (RpcRequest.LIST_FEDERATION_REGISTRATIONS.equals(reqType)) {
// return the list of federation registrations
if (allowAdmin) {