API: fix commits pagination

closes #2300
This commit is contained in:
Nihad Abbasov 2013-02-27 06:00:33 -08:00
parent 135418dcbf
commit 8d847b89d2

View file

@ -292,7 +292,7 @@ module Gitlab
authorize! :download_code, user_project
page = params[:page] || 0
per_page = params[:per_page] || 20
per_page = params[:per_page].to_i || 20
ref = params[:ref_name] || user_project.try(:default_branch) || 'master'
commits = user_project.repository.commits(ref, nil, per_page, page * per_page)