Remove project state check from ChangeControl#addPatchSet

All callers are already explicitly checking for the project state so
there is no need to perform the check implicitly once more.

Change-Id: I956eddb1647778454293a47bfee5459952783b17
This commit is contained in:
Patrick Hiesel
2018-01-15 17:32:25 +01:00
parent 1cfd4d1772
commit 42be51720a

View File

@@ -176,9 +176,7 @@ class ChangeControl {
/** Can this user add a patch set to this change? */
private boolean canAddPatchSet(ReviewDb db) throws OrmException {
if (!(refControl.asForRef().testOrFalse(RefPermission.CREATE_CHANGE)
&& getProjectControl().getProjectState().statePermitsWrite())
|| isPatchSetLocked(db)) {
if (!(refControl.asForRef().testOrFalse(RefPermission.CREATE_CHANGE)) || isPatchSetLocked(db)) {
return false;
}
if (isOwner()) {