diff options
| author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-11 01:28:26 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-11 01:28:26 +0200 |
| commit | d730e3ef8b1c9bf73f9eeb492968b455fbec319d (patch) | |
| tree | d160e848e1b2dab3f4ce7715910a19e1502a38f4 /app/controllers/projects_controller.rb | |
| parent | dab072c1ab609917c3472ae663f1db49af75e56e (diff) | |
| download | gitlab-ce-d730e3ef8b1c9bf73f9eeb492968b455fbec319d.tar.gz | |
refactoring project, commits controllers
Diffstat (limited to 'app/controllers/projects_controller.rb')
| -rw-r--r-- | app/controllers/projects_controller.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5e00fe461e6..0494e1820de 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -6,8 +6,8 @@ class ProjectsController < ApplicationController before_filter :add_project_abilities before_filter :authorize_read_project!, :except => [:index, :new, :create] before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] - before_filter :require_non_empty_project, :only => [:blob, :tree] + before_filter :load_refs, :only => :tree # load @branch, @tag & @ref def index source = current_user.projects @@ -101,15 +101,13 @@ class ProjectsController < ApplicationController # def tree - load_refs # load @branch, @tag & @ref - @repo = project.repo - if params[:commit_id] - @commit = @repo.commits(params[:commit_id]).first - else - @commit = @repo.commits(@ref).first - end + @commit = if params[:commit_id] + @repo.commits(params[:commit_id]).first + else + @repo.commits(@ref).first + end @tree = @commit.tree @tree = @tree / params[:path] if params[:path] |
