Limit maximum Git object size on git push.

Gerrit administrator may want to limit the maximum Git object size
accepted by Gerrit in order to prevent users from pushing too large
files. A new setting is introduced in the receive section:

[receive]
	maxObjectSizeLimit = 40 m
	...

The setting is system wide as we don't want to allow project owners to
change this setting for their project.

Change-Id: Idbe3958f6e0739de9d99d9c5154d90fcb5cbdeb4
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
Sasa Zivkov
2011-11-18 15:32:35 +01:00
parent 3b44b5c845
commit 59d89c3eb2
3 changed files with 26 additions and 3 deletions

View File

@@ -85,6 +85,7 @@ final class Receive extends AbstractGitCommand {
final ReceivePack rp = receive.getReceivePack();
rp.setRefLogIdent(currentUser.newRefLogIdent());
rp.setTimeout(config.getTimeout());
rp.setMaxObjectSizeLimit(config.getMaxObjectSizeLimit());
try {
receive.advertiseHistory();
rp.receive(in, out, err);