summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-04-24 16:27:19 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-04-24 16:27:24 +0300
commitbbe1f786e2c1e0ab3d5fb73d9ac03e41f3b92918 (patch)
tree88ee0ea29c6a9b5efc6370b12f4b46488cd19f8b
parent0e124cee2479534eee427f96bf83db79938f0c0e (diff)
downloadgitlab-ce-24728-don-t-explicitely-call-repository-in-projects-applicationcontroller-and-descendants.tar.gz
We should only call the #repository accessor when needed. And get rid of before_action :repository. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/controllers/projects/application_controller.rb1
-rw-r--r--app/controllers/projects/clusters_controller.rb1
-rw-r--r--app/controllers/projects/git_http_client_controller.rb1
-rw-r--r--app/controllers/projects_controller.rb1
4 files changed, 0 insertions, 4 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 781eac7f080..3235054d1a5 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -8,7 +8,6 @@ class Projects::ApplicationController < ApplicationController
skip_before_action :authenticate_user!
before_action :project
- before_action :repository
layout 'project'
helper_method :repository, :can_collaborate_with_project?, :user_access
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index feda6deeaa6..efc464bed04 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -4,7 +4,6 @@ class Projects::ClustersController < Clusters::ClustersController
include ProjectUnauthorized
prepend_before_action :project
- before_action :repository
layout 'project'
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index 7a80da53025..7d131011e1a 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -16,7 +16,6 @@ class Projects::GitHttpClientController < Projects::ApplicationController
# Git clients will not know what authenticity token to send along
skip_before_action :verify_authenticity_token
- skip_before_action :repository
before_action :authenticate_user
private
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 48f4d7a586d..1632edd4155 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -16,7 +16,6 @@ class ProjectsController < Projects::ApplicationController
before_action :authenticate_user!, except: [:index, :show, :activity, :refs, :resolve]
before_action :redirect_git_extension, only: [:show]
before_action :project, except: [:index, :new, :create, :resolve]
- before_action :repository, except: [:index, :new, :create, :resolve]
before_action :assign_ref_vars, only: [:show], if: :repo_exists?
before_action :tree, only: [:show], if: [:repo_exists?, :project_view_files?]
before_action :lfs_blob_ids, only: [:show], if: [:repo_exists?, :project_view_files?]