diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-07 12:25:42 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-07 12:25:42 +0000 |
commit | 33316f7f176d76b05bcf8bd0ff4d9dbc43e7c061 (patch) | |
tree | c933719eb9c0b1dcab6f0ac8532af0416c0afbc8 /app | |
parent | c62ef08a40b6213b8df3fe47a1c6104d0d693a8e (diff) | |
parent | 0d8e9f6ee3a49e00b7831b88486b1cbda83026cb (diff) | |
download | gitlab-ce-33316f7f176d76b05bcf8bd0ff4d9dbc43e7c061.tar.gz |
Merge branch 'sh-improve-find-commit-caching' into 'master'
Expand FindCommit caching to blob and refs
See merge request gitlab-org/gitlab-ce!27084
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/commits_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/projects/refs_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 4 |
4 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 7e072788fc9..b04ffe80db4 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -9,6 +9,8 @@ class Projects::BlobController < Projects::ApplicationController include ActionView::Helpers::SanitizeHelper prepend_before_action :authenticate_user!, only: [:edit] + around_action :allow_gitaly_ref_name_caching, only: [:show] + before_action :require_non_empty_project, except: [:new, :create] before_action :authorize_download_code! diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index a49ede04de7..f540ccee386 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -7,6 +7,7 @@ class Projects::CommitsController < Projects::ApplicationController include RendersCommits prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) } + around_action :allow_gitaly_ref_name_caching before_action :whitelist_query_limiting, except: :commits_root before_action :require_non_empty_project before_action :assign_ref_vars, except: :commits_root @@ -14,8 +15,6 @@ class Projects::CommitsController < Projects::ApplicationController before_action :validate_ref!, except: :commits_root before_action :set_commits, except: :commits_root - around_action :allow_gitaly_ref_name_caching - def commits_root redirect_to project_commits_path(@project, @project.default_branch) end diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb index b97fbe19bbf..b3447812ef2 100644 --- a/app/controllers/projects/refs_controller.rb +++ b/app/controllers/projects/refs_controller.rb @@ -4,6 +4,8 @@ class Projects::RefsController < Projects::ApplicationController include ExtractsPath include TreeHelper + around_action :allow_gitaly_ref_name_caching, only: [:logs_tree] + before_action :require_non_empty_project before_action :validate_ref_id before_action :assign_ref_vars diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 94258e0e90a..89dc43a48a1 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -10,6 +10,8 @@ class ProjectsController < Projects::ApplicationController prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) } + around_action :allow_gitaly_ref_name_caching, only: [:index, :show] + before_action :whitelist_query_limiting, only: [:create] before_action :authenticate_user!, except: [:index, :show, :activity, :refs, :resolve] before_action :redirect_git_extension, only: [:show] @@ -26,8 +28,6 @@ class ProjectsController < Projects::ApplicationController before_action :authorize_admin_project!, only: [:edit, :update, :housekeeping, :download_export, :export, :remove_export, :generate_new_export] before_action :event_filter, only: [:show, :activity] - around_action :allow_gitaly_ref_name_caching, only: [:index, :show] - layout :determine_layout def index |