Make project state check in FORCE_UPDATE explicit
The majority of code in {Project,Ref,Change}Control is now about permissions, but not all. Exceptions include checks for a project's state. This is confusing, because users are presented with an exception telling them that they lack some kind of permission while the real reason for the failed operation is that the project's current state doesn't permit the operation. This is part of a series of commits to remove all project state checks from *Control classes and make explicit checks instead. Change-Id: Ic497f0bbd6c0c128d3df81be34c382bba1a0d1b0
This commit is contained in:
@@ -1159,6 +1159,9 @@ class ReceiveCommits {
|
||||
if (!validRefOperation(cmd)) {
|
||||
return;
|
||||
}
|
||||
if (!projectState.statePermitsWrite()) {
|
||||
cmd.setResult(REJECTED_NONFASTFORWARD, " project state does not permit write.");
|
||||
}
|
||||
actualCommands.add(cmd);
|
||||
} else {
|
||||
cmd.setResult(
|
||||
|
Reference in New Issue
Block a user