Support to retrieve a branch via REST

GET on /projects/<project-name>/branches/<branch-id> retrieves a
branch.

Change-Id: I1c2c81dcc5292d644d8048436c142039a4274e32
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-05-09 15:12:34 +02:00
parent 4076287120
commit 196e173aac
5 changed files with 87 additions and 8 deletions

View File

@@ -15,21 +15,21 @@
package com.google.gerrit.server.project;
import com.google.gerrit.extensions.restapi.RestView;
import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.server.project.ListBranches.BranchInfo;
import com.google.inject.TypeLiteral;
public class BranchResource extends ProjectResource {
public static final TypeLiteral<RestView<BranchResource>> BRANCH_KIND =
new TypeLiteral<RestView<BranchResource>>() {};
private final Branch.NameKey branch;
private final BranchInfo branchInfo;
public BranchResource(ProjectControl control, Branch.NameKey branch) {
public BranchResource(ProjectControl control, BranchInfo branchInfo) {
super(control);
this.branch = branch;
this.branchInfo = branchInfo;
}
public Branch.NameKey getBranch() {
return branch;
public BranchInfo getBranchInfo() {
return branchInfo;
}
}