From 7d2affeff1885fb9984fed1088c8dffdc41a7320 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Dec 2017 10:10:20 +0000 Subject: moved lfs blob fetch from extractspath file --- app/controllers/projects_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers/projects_controller.rb') diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 3882fa4791d..bce3a8d42e4 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -9,6 +9,7 @@ class ProjectsController < Projects::ApplicationController before_action :repository, except: [:index, :new, :create] 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?] before_action :project_export_enabled, only: [:export, :download_export, :remove_export, :generate_new_export] # Authorize @@ -403,4 +404,9 @@ class ProjectsController < Projects::ApplicationController # redirect_to request.original_url.sub(/\.git\/?\Z/, '') if params[:format] == 'git' end + + def lfs_blob_ids + blob_ids = tree.blobs.map(&:id) + @lfs_blob_ids = Gitlab::Git::Blob.batch_lfs_pointers(@repo, blob_ids).map(&:id) + end end -- cgit v1.2.1 From cbd3ce8f41fc5691a1d23aca0ffe3221ab5d26af Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Dec 2017 11:59:01 +0000 Subject: moved lfs_blob_ids method into ExtractsPath module --- app/controllers/projects_controller.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'app/controllers/projects_controller.rb') diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index bce3a8d42e4..b06981b4b1d 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -404,9 +404,4 @@ class ProjectsController < Projects::ApplicationController # redirect_to request.original_url.sub(/\.git\/?\Z/, '') if params[:format] == 'git' end - - def lfs_blob_ids - blob_ids = tree.blobs.map(&:id) - @lfs_blob_ids = Gitlab::Git::Blob.batch_lfs_pointers(@repo, blob_ids).map(&:id) - end end -- cgit v1.2.1