Browse Source

Remove PreUploadHook.onPreAdvertiseRefs

AdvertiseRefsHook.advertiseRefs subsumes this behavior.

Change-Id: Id2d1ebb2503c9ba79eda58aaea2fd76ec233427f
stable-2.0
Dave Borowitz 13 years ago committed by Shawn O. Pearce
parent
commit
903e1b81d4
  1. 20
      org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java
  2. 6
      org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java
  3. 1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

20
org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java

@ -58,11 +58,6 @@ import org.eclipse.jgit.lib.ObjectId;
public interface PreUploadHook { public interface PreUploadHook {
/** A simple no-op hook. */ /** A simple no-op hook. */
public static final PreUploadHook NULL = new PreUploadHook() { public static final PreUploadHook NULL = new PreUploadHook() {
public void onPreAdvertiseRefs(UploadPack up)
throws ServiceMayNotContinueException {
// Do nothing.
}
public void onBeginNegotiateRound(UploadPack up, public void onBeginNegotiateRound(UploadPack up,
Collection<? extends ObjectId> wants, int cntOffered) Collection<? extends ObjectId> wants, int cntOffered)
throws ServiceMayNotContinueException { throws ServiceMayNotContinueException {
@ -84,21 +79,6 @@ public interface PreUploadHook {
} }
}; };
/**
* Invoked just before {@link UploadPack#sendAdvertisedRefs(RefAdvertiser)}.
* <p>
* New code should prefer implementing
* {@link AdvertiseRefsHook#advertiseRefs(UploadPack)}, which is more powerful
* and may replace this method in the future.
*
* @param up
* the upload pack instance handling the connection.
* @throws ServiceMayNotContinueException
* abort; the message will be sent to the user.
*/
public void onPreAdvertiseRefs(UploadPack up)
throws ServiceMayNotContinueException;
/** /**
* Invoked before negotiation round is started. * Invoked before negotiation round is started.
* *

6
org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java

@ -79,12 +79,6 @@ public class PreUploadHookChain implements PreUploadHook {
return new PreUploadHookChain(newHooks, i); return new PreUploadHookChain(newHooks, i);
} }
public void onPreAdvertiseRefs(UploadPack up)
throws ServiceMayNotContinueException {
for (int i = 0; i < count; i++)
hooks[i].onPreAdvertiseRefs(up);
}
public void onBeginNegotiateRound(UploadPack up, public void onBeginNegotiateRound(UploadPack up,
Collection<? extends ObjectId> wants, int cntOffered) Collection<? extends ObjectId> wants, int cntOffered)
throws ServiceMayNotContinueException { throws ServiceMayNotContinueException {

1
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

@ -609,7 +609,6 @@ public class UploadPack {
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException,
ServiceMayNotContinueException { ServiceMayNotContinueException {
try { try {
preUploadHook.onPreAdvertiseRefs(this);
advertiseRefsHook.advertiseRefs(this); advertiseRefsHook.advertiseRefs(this);
} catch (ServiceMayNotContinueException fail) { } catch (ServiceMayNotContinueException fail) {
if (fail.getMessage() != null) { if (fail.getMessage() != null) {

Loading…
Cancel
Save