Commit cbd3ce8f authored by Phil Hughes's avatar Phil Hughes

moved lfs_blob_ids method into ExtractsPath module

parent 9c132216
...@@ -26,10 +26,8 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -26,10 +26,8 @@ class Projects::TreeController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
blob_ids = tree.blobs.map(&:id) lfs_blob_ids
@last_commit = @repository.last_commit_for_path(@commit.id, @tree.path) || @commit @last_commit = @repository.last_commit_for_path(@commit.id, @tree.path) || @commit
@lfs_blob_ids = Gitlab::Git::Blob.batch_lfs_pointers(@repo, blob_ids).map(&:id)
end end
format.js do format.js do
......
...@@ -404,9 +404,4 @@ class ProjectsController < Projects::ApplicationController ...@@ -404,9 +404,4 @@ class ProjectsController < Projects::ApplicationController
# #
redirect_to request.original_url.sub(/\.git\/?\Z/, '') if params[:format] == 'git' redirect_to request.original_url.sub(/\.git\/?\Z/, '') if params[:format] == 'git'
end 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 end
...@@ -135,6 +135,11 @@ module ExtractsPath ...@@ -135,6 +135,11 @@ module ExtractsPath
@tree ||= @repo.tree(@commit.id, @path) @tree ||= @repo.tree(@commit.id, @path)
end end
def lfs_blob_ids
blob_ids = tree.blobs.map(&:id)
@lfs_blob_ids = Gitlab::Git::Blob.batch_lfs_pointers(@project.repository, blob_ids).map(&:id)
end
private private
# overriden in subclasses, do not remove # overriden in subclasses, do not remove
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment