Skip to content

Commit 526b385

Browse files
authored
Merge pull request #1187 from gitblit/revert-1186-listBranchForRepository
Revert "New rpc endpoint for listing all branches from a given repository"
2 parents bfa7b43 + 6a7496f commit 526b385

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

src/main/java/com/gitblit/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public static enum RpcRequest {
410410
// Order is important here. anything after LIST_SETTINGS requires
411411
// administrator privileges and web.allowRpcManagement.
412412
CLEAR_REPOSITORY_CACHE, REINDEX_TICKETS, GET_PROTOCOL, LIST_REPOSITORIES, LIST_BRANCHES, GET_USER,
413-
FORK_REPOSITORY, LIST_REPOSITORY_BRANCHES, LIST_SETTINGS,
413+
FORK_REPOSITORY, LIST_SETTINGS,
414414
CREATE_REPOSITORY, EDIT_REPOSITORY, DELETE_REPOSITORY,
415415
LIST_USERS, CREATE_USER, EDIT_USER, DELETE_USER,
416416
LIST_TEAMS, CREATE_TEAM, EDIT_TEAM, DELETE_TEAM,

src/main/java/com/gitblit/servlet/RpcServlet.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,18 +328,6 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
328328
Collection<RegistrantAccessPermission> permissions = deserialize(request, response,
329329
RpcUtils.REGISTRANT_PERMISSIONS_TYPE);
330330
result = gitblit.setTeamAccessPermissions(model, permissions);
331-
} else if (RpcRequest.LIST_REPOSITORY_BRANCHES.equals(reqType)) {
332-
333-
// list all branches for the given repository
334-
Repository repository = gitblit.getRepository(objectName);
335-
List<RefModel> refs = JGitUtils.getLocalBranches(repository, false, -1);
336-
337-
List<String> branches = new ArrayList<>();
338-
for (RefModel ref : refs) {
339-
branches.add(ref.getName());
340-
}
341-
repository.close();
342-
result = branches;
343331
} else if (RpcRequest.LIST_FEDERATION_REGISTRATIONS.equals(reqType)) {
344332
// return the list of federation registrations
345333
if (allowAdmin) {

src/site/rpc.mkd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ The Gitblit API includes methods for retrieving and interpreting RSS feeds. The
6262
<tr><td>Gitblit v1.3.1</td><td>6</td></tr>
6363
<tr><td>Gitblit v1.4.0</td><td>7</td></tr>
6464
<tr><td>Gitblit v1.6.0</td><td>8</td></tr>
65-
<tr><td>Gitblit v1.9.0</td><td>9</td></tr>
6665
</tbody>
6766
</table>
6867

@@ -105,7 +104,6 @@ Use *SET_REPOSITORY_TEAM_PERMISSIONS* instead.
105104
<tr><td><s>SET_REPOSITORY_TEAMS</s></td><td><s>repository name</s></td><td><em><s>admin</s></em></td><td><s>2</s></td><td><s>List&lt;String&gt;</s></td><td>-</td></tr>
106105
<tr><td>LIST_REPOSITORY_TEAM_PERMISSIONS</td><td>repository name</td><td><em>admin</em></td><td>5</td><td>-</td><td>List&lt;String&gt;</td></tr>
107106
<tr><td>SET_REPOSITORY_TEAM_PERMISSIONS</td><td>repository name</td><td><em>admin</em></td><td>5</td><td>List&lt;String&gt;</td><td>-</td></tr>
108-
<tr><td>LIST_REPOSITORY_BRANCHES</td><td>repository name</td><td><em>-</em></td><td>9</td><td>-</td><td>List&lt;String&gt;</td></tr>
109107
<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (management keys)</td></tr>
110108
<tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>-</em></td><td>4</td><td>-</td><td>-</td></tr>
111109
<tr><td>REINDEX_TICKETS</td><td>repository name</td><td><em>-</em></td><td>7</td><td>-</td><td>-</td></tr>

0 commit comments

Comments
 (0)