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>
3 files changed