Add CLA check to ProjectControl.canPushToAtLeastOneRef()

This is a refactoring, it should not change functionality
at all.  Move CLA check out of ReceiveCommits and into
ProjectControl.  Create a common Capable class to facilitate
this.

Change-Id: I43ff798bcb727918eb39b1ec8dc7e14278c91b1f
This commit is contained in:
Martin Fick
2011-06-17 16:45:18 -06:00
parent e01f37016d
commit 21a4f5c3b6
6 changed files with 224 additions and 169 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.sshd.commands;
import com.google.gerrit.common.data.Capable;
import com.google.gerrit.reviewdb.Account;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.git.ReceiveCommits;
@@ -70,8 +71,8 @@ final class Receive extends AbstractGitCommand {
final ReceiveCommits receive = factory.create(projectControl, repo);
ReceiveCommits.Capable r = receive.canUpload();
if (r != ReceiveCommits.Capable.OK) {
Capable r = receive.canUpload();
if (r != Capable.OK) {
throw new UnloggedFailure(1, "\nfatal: " + r.getMessage());
}