commit paging fixes

This commit is contained in:
Dmitriy Zaporozhets 2011-11-05 14:26:06 +02:00
parent 586c53ea05
commit 5eecbfdb10
7 changed files with 68 additions and 14 deletions

View file

@ -13,11 +13,12 @@ class CommitsController < ApplicationController
load_refs # load @branch, @tag & @ref
@repo = project.repo
limit, offset = (params[:limit] || 20), (params[:offset] || 0)
if params[:path]
@commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0)
@commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset)
else
@commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0)
@commits = @repo.commits(@ref, limit, offset)
end
respond_to do |format|