]> source.dussan.org Git - jgit.git/commitdiff
Remove PreUploadHook.onPreAdvertiseRefs 85/5085/5
authorDave Borowitz <dborowitz@google.com>
Tue, 14 Feb 2012 18:33:05 +0000 (10:33 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 1 Mar 2012 03:09:24 +0000 (19:09 -0800)
AdvertiseRefsHook.advertiseRefs subsumes this behavior.

Change-Id: Id2d1ebb2503c9ba79eda58aaea2fd76ec233427f

org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

index 91de77da988d300dbc1f42895d5766d81dcbb2db..0360f120e0fe2ed67e02e2668a2c348c6955d5e4 100644 (file)
@@ -58,11 +58,6 @@ import org.eclipse.jgit.lib.ObjectId;
 public interface PreUploadHook {
        /** A simple no-op hook. */
        public static final PreUploadHook NULL = new PreUploadHook() {
-               public void onPreAdvertiseRefs(UploadPack up)
-                               throws ServiceMayNotContinueException {
-                       // Do nothing.
-               }
-
                public void onBeginNegotiateRound(UploadPack up,
                                Collection<? extends ObjectId> wants, int cntOffered)
                                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.
         *
index 25323eb5f2ad2f9b430f6501d6006b5bea463ada..7f515e038ca3843985405c3c8be5fbaf1a532499 100644 (file)
@@ -79,12 +79,6 @@ public class PreUploadHookChain implements PreUploadHook {
                        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,
                        Collection<? extends ObjectId> wants, int cntOffered)
                        throws ServiceMayNotContinueException {
index debbab51fc8c038662b5b576e6a4d58603362e6b..c61a23cabbb4b556461bd78e9c2645290c43fd5c 100644 (file)
@@ -609,7 +609,6 @@ public class UploadPack {
        public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException,
                        ServiceMayNotContinueException {
                try {
-                       preUploadHook.onPreAdvertiseRefs(this);
                        advertiseRefsHook.advertiseRefs(this);
                } catch (ServiceMayNotContinueException fail) {
                        if (fail.getMessage() != null) {