summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-05-16 12:07:34 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-05-21 10:57:47 +0900
commita2b10e56bd0bb56bb45c9d000167258036b6d3b2 (patch)
treedb2abc26eebec51c904959da0587088316e80154 /org.eclipse.jgit.http.server/src
parent04560921c35380d1664e0a6cb9e645ae04ede1a9 (diff)
downloadjgit-a2b10e56bd0bb56bb45c9d000167258036b6d3b2.tar.gz
jgit-a2b10e56bd0bb56bb45c9d000167258036b6d3b2.zip
InfoRefsServlet: Refactor to not use deprecated methods
- Replace RefDatabase#getRefs(String) with #getRefsByPrefix(String) - Replace RefAdvertiser#send(Map<String, Ref>) with #send(Collection<Ref>) Bug: 534731 Change-Id: I25b617c3b0c54793cf4ab5b62f002e17745a5377 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java8
1 files changed, 1 insertions, 7 deletions
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<String, Ref> refs = db.getRefDatabase().getRefs(ALL);
- refs.remove(Constants.HEAD);
- adv.send(refs);
+ adv.send(db.getRefDatabase().getRefsByPrefix(Constants.R_REFS));
}
}
}