public class HackPushNegotiateHook extends Object implements org.eclipse.jgit.transport.AdvertiseRefsHook
This is a hack to work around the lack of negotiation in the send-pack/receive-pack wire protocol.
When the server is frequently advancing master by creating merge commits, the
client may not be able to discover a common ancestor during push. Attempting
to push will re-upload a very large amount of history. This hook hacks in a
fake negotiation replacement by walking history and sending recent commits as
".have" lines in the wire protocol, allowing the client to find a
common ancestor.
| Constructor and Description |
|---|
HackPushNegotiateHook() |
| Modifier and Type | Method and Description |
|---|---|
void |
advertiseRefs(org.eclipse.jgit.transport.BaseReceivePack rp) |
void |
advertiseRefs(org.eclipse.jgit.transport.UploadPack us) |
public void advertiseRefs(org.eclipse.jgit.transport.UploadPack us)
advertiseRefs in interface org.eclipse.jgit.transport.AdvertiseRefsHookpublic void advertiseRefs(org.eclipse.jgit.transport.BaseReceivePack rp)
throws org.eclipse.jgit.transport.ServiceMayNotContinueException
advertiseRefs in interface org.eclipse.jgit.transport.AdvertiseRefsHookorg.eclipse.jgit.transport.ServiceMayNotContinueException