]> source.dussan.org Git - gitblit.git/commitdiff
List branches from only one repository if a repository name is given 1192/head
authorMarkus Fömpe <markus.foempe@gmail.com>
Thu, 26 Jan 2017 12:50:54 +0000 (13:50 +0100)
committerMarkus Fömpe <markus.foempe@gmail.com>
Thu, 26 Jan 2017 14:01:05 +0000 (15:01 +0100)
e.g.: https://localhost:8443/rpc/?req=LIST_REPOSITORY_BRANCHES&name=repo.git

Fix #1184

src/main/java/com/gitblit/servlet/RpcServlet.java
src/site/rpc.mkd

index 9809a2525e5f99906849c8806838afec831ecaec..0081367f65037b9477012689d13cb1b09f273e40 100644 (file)
@@ -133,6 +133,10 @@ public class RpcServlet extends JsonServlet {
                                                        model.name));\r
                                        continue;\r
                                }\r
+                               if(!StringUtils.isEmpty(objectName) && !objectName.equals(model.name)) {\r
+                                       // skip repository if a name was submitted and it doesn't match\r
+                                       continue;\r
+                               }\r
                                // get local branches\r
                                Repository repository = gitblit.getRepository(model.name);\r
                                List<RefModel> refs = JGitUtils.getLocalBranches(repository, false, -1);\r
index 4b065bf05c89bfdbd6949336d2eff90ce902940d..e51fbaaec2c16e4fcff0e354fc8caedb7ad8dc5a 100644 (file)
@@ -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>\r
 <tr><td>Gitblit v1.4.0</td><td>7</td></tr>\r
 <tr><td>Gitblit v1.6.0</td><td>8</td></tr>\r
+<tr><td>Gitblit v1.9.0</td><td>9</td></tr>\r
 </tbody>\r
 </table>\r
 \r
@@ -80,7 +81,7 @@ Use *SET_REPOSITORY_TEAM_PERMISSIONS* instead.
 <tr><td colspan='6'><em>web.enableRpcServlet=true</em></td></tr>\r
 <tr><td>GET_PROTOCOL</td><td>-</td><td>-</td><td>2</td><td>-</td><td>Integer</td></tr>\r
 <tr><td>LIST_REPOSITORIES</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Map&lt;String, RepositoryModel&gt;</td></tr>\r
-<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>\r
+<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>\r
 <tr><td>LIST_SETTINGS</td><td>-</td><td><em>-</em></td><td>1</td><td>-</td><td>ServerSettings (basic keys)</td></tr>\r
 <tr><td>GET_USER</td><td>user name</td><td>-</td><td>6</td><td>-</td><td>UserModel</td></tr>\r
 <tr><td>FORK_REPOSITORY</td><td>repository name</td><td><em>-</em></td><td>8</td><td>-</td><td>-</td></tr>\r