Avoid huge pushes during refs/for/BRANCH push over SSH

Earlier I fixed the huge push problem, but only for smart HTTP.  I
forgot to apply the same logic to the advertisements offered over SSH,
as the SSH variant doesn't require the cache to carry the ObjectIds
from one request into the next.

Move the logic to the common ReceiveCommits class, and apply it to
both the smart HTTP and SSH protocols.

Change-Id: I96be6ec4c15d05f7667c9cb3adf221e29a1c3a33
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2011-04-06 16:59:53 -04:00
parent 15779d950d
commit d1fac8378f
3 changed files with 82 additions and 89 deletions

View File

@@ -86,6 +86,7 @@ final class Receive extends AbstractGitCommand {
rp.setRefLogIdent(currentUser.newRefLogIdent());
rp.setTimeout(config.getTimeout());
try {
receive.advertiseHistory();
rp.receive(in, out, err);
} catch (InterruptedIOException err) {
throw new Failure(128, "fatal: client IO read/write timeout", err);