James Moger
2011-11-04 41cffba4298d61383d0dd99857429960a4ca3d44
src/com/gitblit/SyndicationServlet.java
@@ -33,7 +33,6 @@
import com.gitblit.models.SyndicatedEntryModel;
import com.gitblit.utils.HttpUtils;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.JGitUtils.SearchType;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.SyndicationUtils;
@@ -130,10 +129,11 @@
      String repositoryName = url;
      String objectId = request.getParameter("h");
      String l = request.getParameter("l");
      String page = request.getParameter("pg");
      String searchString = request.getParameter("s");
      SearchType searchType = SearchType.COMMIT;
      Constants.SearchType searchType = Constants.SearchType.COMMIT;
      if (!StringUtils.isEmpty(request.getParameter("st"))) {
         SearchType type = SearchType.forName(request.getParameter("st"));
         Constants.SearchType type = Constants.SearchType.forName(request.getParameter("st"));
         if (type != null) {
            searchType = type;
         }
@@ -148,6 +148,13 @@
         } catch (NumberFormatException x) {
         }
      }
      int offset = 0;
      if (!StringUtils.isEmpty(page)) {
         try {
            offset = length * Integer.parseInt(page);
         } catch (NumberFormatException x) {
         }
      }
      response.setContentType("application/rss+xml; charset=UTF-8");
      Repository repository = GitBlit.self().getRepository(repositoryName);
@@ -155,11 +162,11 @@
      List<RevCommit> commits;
      if (StringUtils.isEmpty(searchString)) {
         // standard log/history lookup
         commits = JGitUtils.getRevLog(repository, objectId, 0, length);
         commits = JGitUtils.getRevLog(repository, objectId, offset, length);
      } else {
         // repository search
         commits = JGitUtils.searchRevlogs(repository, objectId, searchString, searchType, 0,
               length);
         commits = JGitUtils.searchRevlogs(repository, objectId, searchString, searchType,
               offset, length);
      }
      Map<ObjectId, List<RefModel>> allRefs = JGitUtils.getAllRefs(repository);
      List<SyndicatedEntryModel> entries = new ArrayList<SyndicatedEntryModel>();