refactoring + remove unnecessary feature

This commit is contained in:
gitlabhq 2011-10-14 19:30:31 +03:00
parent 2d577cae9d
commit 153f6cd86b
7 changed files with 36 additions and 50 deletions

View file

@ -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|