From a2b10e56bd0bb56bb45c9d000167258036b6d3b2 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 16 May 2018 12:07:34 +0900 Subject: InfoRefsServlet: Refactor to not use deprecated methods - Replace RefDatabase#getRefs(String) with #getRefsByPrefix(String) - Replace RefAdvertiser#send(Map) with #send(Collection) Bug: 534731 Change-Id: I25b617c3b0c54793cf4ab5b62f002e17745a5377 Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/http/server/InfoRefsServlet.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'org.eclipse.jgit.http.server') diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java index d7f6fbf291..0f4633b5e3 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java @@ -44,18 +44,15 @@ package org.eclipse.jgit.http.server; import static org.eclipse.jgit.http.server.ServletUtils.getRepository; -import static org.eclipse.jgit.lib.RefDatabase.ALL; import java.io.IOException; import java.io.OutputStreamWriter; -import java.util.Map; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jgit.lib.Constants; -import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.RefAdvertiser; import org.eclipse.jgit.util.HttpSupport; @@ -94,10 +91,7 @@ class InfoRefsServlet extends HttpServlet { }; adv.init(db); adv.setDerefTags(true); - - Map refs = db.getRefDatabase().getRefs(ALL); - refs.remove(Constants.HEAD); - adv.send(refs); + adv.send(db.getRefDatabase().getRefsByPrefix(Constants.R_REFS)); } } } -- cgit v1.2.3