refactoring + remove unnecessary feature
This commit is contained in:
parent
2d577cae9d
commit
153f6cd86b
7 changed files with 36 additions and 50 deletions
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue