moved lfs_blob_ids method into ExtractsPath module

This commit is contained in:
Phil Hughes 2017-12-14 11:59:01 +00:00
parent 9c132216b7
commit cbd3ce8f41
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
3 changed files with 6 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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