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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user