use of com.google.gerrit.extensions.api.projects.BranchInfo in project gerrit by GerritCodeReview.
the class ListBranchesIT method branch.
private static BranchInfo branch(String ref, String revision, boolean canDelete) {
BranchInfo info = new BranchInfo();
info.ref = ref;
info.revision = revision;
info.canDelete = canDelete ? true : null;
return info;
}
use of com.google.gerrit.extensions.api.projects.BranchInfo in project gerrit by GerritCodeReview.
the class BranchesCollection method parse.
@Override
public BranchResource parse(ProjectResource parent, IdString id) throws ResourceNotFoundException, IOException, BadRequestException {
String branchName = id.get();
if (!branchName.equals(Constants.HEAD)) {
branchName = RefNames.fullName(branchName);
}
List<BranchInfo> branches = list.get().apply(parent);
for (BranchInfo b : branches) {
if (branchName.equals(b.ref)) {
return new BranchResource(parent.getControl(), b);
}
}
throw new ResourceNotFoundException();
}
Aggregations