summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2017-02-08 09:34:07 -0500
committerGitHub <noreply@github.com>2017-02-08 09:34:07 -0500
commit3d569f8ce066a6cadf021cbebcc8152b315db2d7 (patch)
tree9ff859c069c8a165656bdd3f8c5cf667bca9472c
parentcf2032c6820ab5cb88d82a4c229128a3674d7903 (diff)
parent61df9b9f633cd5ce176077ad0e1ce8436f019f0c (diff)
downloadgitblit-3d569f8ce066a6cadf021cbebcc8152b315db2d7.tar.gz
gitblit-3d569f8ce066a6cadf021cbebcc8152b315db2d7.zip
Merge pull request #1192 from mystygage/listBranchForRepository
List branches from only one repository if a repository name is given
-rw-r--r--src/main/java/com/gitblit/servlet/RpcServlet.java4
-rw-r--r--src/site/rpc.mkd3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/servlet/RpcServlet.java b/src/main/java/com/gitblit/servlet/RpcServlet.java
index 9809a252..0081367f 100644
--- a/src/main/java/com/gitblit/servlet/RpcServlet.java
+++ b/src/main/java/com/gitblit/servlet/RpcServlet.java
@@ -133,6 +133,10 @@ public class RpcServlet extends JsonServlet {
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);
diff --git a/src/site/rpc.mkd b/src/site/rpc.mkd
index 4b065bf0..e51fbaae 100644
--- a/src/site/rpc.mkd
+++ b/src/site/rpc.mkd
@@ -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>
@@ -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>