moved lfs_blob_ids method into ExtractsPath module
This commit is contained in:
parent
9c132216b7
commit
cbd3ce8f41
3 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue