Limit max number of changes pushed in a batch.

'receive.maxBatchChanges' is the maximum number of changes that
Gerrit allows to be pushed in a batch for review. When it is
exceeded Gerrit rejects the push with an error message.

This setting can be used to prevent users from uploading large
number of changes by mistake, e.g. when pushing deliveries from
external git repositories.

Default is zero, no limit.

Change-Id: Ib9821190d3c88ac9a2efbb552e21c257165a9443
This commit is contained in:
Bruce Zu
2014-07-30 14:50:01 +08:00
parent 0ff53a4a42
commit e13b65d8d5
3 changed files with 20 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ class ReceiveConfig {
final boolean checkMagicRefs;
final boolean checkReferencedObjectsAreReachable;
final boolean allowDrafts;
final int maxBatchChanges;
@Inject
ReceiveConfig(@GerritServerConfig Config config) {
@@ -37,5 +38,6 @@ class ReceiveConfig {
allowDrafts = config.getBoolean(
"change", null, "allowDrafts",
true);
maxBatchChanges = config.getInt("receive", "maxBatchChanges", 0);
}
}