From 903e1b81d43af97e9aff611c77e82cb0969530d8 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 14 Feb 2012 10:33:05 -0800 Subject: [PATCH] Remove PreUploadHook.onPreAdvertiseRefs AdvertiseRefsHook.advertiseRefs subsumes this behavior. Change-Id: Id2d1ebb2503c9ba79eda58aaea2fd76ec233427f --- .../eclipse/jgit/transport/PreUploadHook.java | 20 ------------------- .../jgit/transport/PreUploadHookChain.java | 6 ------ .../eclipse/jgit/transport/UploadPack.java | 1 - 3 files changed, 27 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java index 91de77da9..0360f120e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java @@ -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 wants, int cntOffered) throws ServiceMayNotContinueException { @@ -84,21 +79,6 @@ public interface PreUploadHook { } }; - /** - * Invoked just before {@link UploadPack#sendAdvertisedRefs(RefAdvertiser)}. - *

- * 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. * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java index 25323eb5f..7f515e038 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java @@ -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 wants, int cntOffered) throws ServiceMayNotContinueException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index debbab51f..c61a23cab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/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, ServiceMayNotContinueException { try { - preUploadHook.onPreAdvertiseRefs(this); advertiseRefsHook.advertiseRefs(this); } catch (ServiceMayNotContinueException fail) { if (fail.getMessage() != null) {