Provide more feedback for 'prohibited by Gerrit'.
This code path continues to be a source of support requests for our team. Change-Id: I14b8cd6d492095d9e7ff5d65d7efad785cc6b4c4
This commit is contained in:
@@ -1070,15 +1070,19 @@ public class ReceiveCommits {
|
||||
}
|
||||
|
||||
RefControl ctl = projectControl.controlForRef(cmd.getRefName());
|
||||
if (ctl.canCreate(rp.getRepository(), obj)) {
|
||||
if (!validRefOperation(cmd)) {
|
||||
return;
|
||||
}
|
||||
validateNewCommits(ctl, cmd);
|
||||
actualCommands.add(cmd);
|
||||
} else {
|
||||
reject(cmd, "prohibited by Gerrit: create access denied for " + cmd.getRefName());
|
||||
String rejectReason = ctl.canCreate(rp.getRepository(), obj);
|
||||
if (rejectReason != null) {
|
||||
reject(cmd, "prohibited by Gerrit: " + rejectReason);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!validRefOperation(cmd)) {
|
||||
// validRefOperation sets messages, so no need to provide more feedback.
|
||||
return;
|
||||
}
|
||||
|
||||
validateNewCommits(ctl, cmd);
|
||||
actualCommands.add(cmd);
|
||||
}
|
||||
|
||||
private void parseUpdate(ReceiveCommand cmd) throws PermissionBackendException {
|
||||
|
||||
Reference in New Issue
Block a user