diff options
Diffstat (limited to 'app/controllers/commits_controller.rb')
-rw-r--r-- | app/controllers/commits_controller.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 61a1a54f84d..fe46ddcefb7 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -8,20 +8,14 @@ class CommitsController < ApplicationController before_filter :authorize_read_project! def index - refs_from_cookie + load_refs # load @branch, @tag & @ref + @repo = project.repo - @branch = if !params[:branch].blank? - params[:branch] - elsif !params[:tag].blank? - params[:tag] - else - "master" - end if params[:path] - @commits = @repo.log(@branch, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0) + @commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0) else - @commits = @repo.commits(@branch, params[:limit] || 100, params[:offset] || 0) + @commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0) end respond_to do |format| |