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
respond_to do |format|
format.html do
blob_ids = tree.blobs.map(&:id)
lfs_blob_ids
@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
format.js do
......
......@@ -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
......@@ -135,6 +135,11 @@ module ExtractsPath
@tree ||= @repo.tree(@commit.id, @path)
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
# 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