Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List branches from only one repository if a repository name is given #1192

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
List branches from only one repository if a repository name is given
e.g.: https://localhost:8443/rpc/?req=LIST_REPOSITORY_BRANCHES&name=repo.git

Fix #1184
  • Loading branch information
mystygage committed Jan 26, 2017
commit 61df9b9f633cd5ce176077ad0e1ce8436f019f0c
4 changes: 4 additions & 0 deletions src/main/java/com/gitblit/servlet/RpcServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
model.name));
continue;
}
if(!StringUtils.isEmpty(objectName) && !objectName.equals(model.name)) {
// skip repository if a name was submitted and it doesn't match
continue;
}
// get local branches
Repository repository = gitblit.getRepository(model.name);
List<RefModel> refs = JGitUtils.getLocalBranches(repository, false, -1);
Expand Down
3 changes: 2 additions & 1 deletion src/site/rpc.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The Gitblit API includes methods for retrieving and interpreting RSS feeds. The
<tr><td>Gitblit v1.3.1</td><td>6</td></tr>
<tr><td>Gitblit v1.4.0</td><td>7</td></tr>
<tr><td>Gitblit v1.6.0</td><td>8</td></tr>
<tr><td>Gitblit v1.9.0</td><td>9</td></tr>
</tbody>
</table>

Expand All @@ -80,7 +81,7 @@ Use *SET_REPOSITORY_TEAM_PERMISSIONS* instead.
<tr><td colspan='6'><em>web.enableRpcServlet=true</em></td></tr>
<tr><td>GET_PROTOCOL</td><td>-</td><td>-</td><td>2</td><td>-</td><td>Integer</td></tr>
<tr><td>LIST_REPOSITORIES</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Map&lt;String, RepositoryModel&gt;</td></tr>
<tr><td>LIST_BRANCHES</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Map&lt;String, List&lt;String&gt;&gt;</td></tr>
<tr><td>LIST_BRANCHES</td><td>[repository name]</td><td>-</td><td>9</td><td>-</td><td>Map&lt;String, List&lt;String&gt;&gt;</td></tr>
<tr><td>LIST_SETTINGS</td><td>-</td><td><em>-</em></td><td>1</td><td>-</td><td>ServerSettings (basic keys)</td></tr>
<tr><td>GET_USER</td><td>user name</td><td>-</td><td>6</td><td>-</td><td>UserModel</td></tr>
<tr><td>FORK_REPOSITORY</td><td>repository name</td><td><em>-</em></td><td>8</td><td>-</td><td>-</td></tr>
Expand Down