use of com.google.gerrit.extensions.api.projects.BanCommitInput in project gerrit by GerritCodeReview.
the class BanCommitCommand method run.
@Override
protected void run() throws Failure {
enableGracefulStop();
try {
BanCommitInput input = BanCommitInput.fromCommits(Lists.transform(commitsToBan, ObjectId::getName));
input.reason = reason;
BanResultInfo r = banCommit.apply(new ProjectResource(projectState, user), input).value();
printCommits(r.newlyBanned, "The following commits were banned");
printCommits(r.alreadyBanned, "The following commits were already banned");
printCommits(r.ignored, "The following ids do not represent commits and were ignored");
} catch (Exception e) {
throw die(e);
}
}
Aggregations