summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2012-02-08 14:30:04 -0800
committerShawn O. Pearce <spearce@spearce.org>2012-02-29 19:09:23 -0800
commit1f2022e3a7e9482caa4823e031504b6bbe8246af (patch)
tree762ff777f289b4a18e11519d12eccaad0694bc55 /org.eclipse.jgit.http.server/src
parent7acd333e7d2e19b48534e3e9c72b19486d6e1b9a (diff)
downloadjgit-1f2022e3a7e9482caa4823e031504b6bbe8246af.tar.gz
jgit-1f2022e3a7e9482caa4823e031504b6bbe8246af.zip
Modify refs in UploadPack/ReceivePack using a hook interface
This is intended to replace the RefFilter interface (but does not yet, for backwards compatibility). That interface required lots of extra scanning and copying in filter cases such as only advertising a subtree of the refs directory. Instead, provide a hook that can be executed right before ref advertisement, using the public methods on UploadPack/ReceivePack to explicitly set the map of advertised refs. Change-Id: I0067019a191c8148af2cfb71a675f2258c5af0ca
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
index c0f1f6335b..907b328db9 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
@@ -65,7 +65,7 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.PacketLineOut;
import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser;
-import org.eclipse.jgit.transport.UploadPackMayNotContinueException;
+import org.eclipse.jgit.transport.ServiceMayNotContinueException;
import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
@@ -137,7 +137,7 @@ abstract class SmartServiceInfoRefs implements Filter {
} catch (ServiceNotEnabledException e) {
sendError(req, res, SC_FORBIDDEN);
- } catch (UploadPackMayNotContinueException e) {
+ } catch (ServiceMayNotContinueException e) {
if (e.isOutput())
buf.close();
else
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
index 15ef2c7eac..36d4588f13 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
@@ -73,7 +73,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser;
import org.eclipse.jgit.transport.UploadPack;
import org.eclipse.jgit.transport.UploadPackInternalServerErrorException;
-import org.eclipse.jgit.transport.UploadPackMayNotContinueException;
+import org.eclipse.jgit.transport.ServiceMayNotContinueException;
import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.transport.resolver.UploadPackFactory;
@@ -176,7 +176,7 @@ class UploadPackServlet extends HttpServlet {
up.upload(getInputStream(req), out, null);
out.close();
- } catch (UploadPackMayNotContinueException e) {
+ } catch (ServiceMayNotContinueException e) {
if (e.isOutput()) {
consumeRequestBody(req);
out.close();