Commit 42d6b081 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'remove-confusing-head' into 'master'

Clean up confusing code in LfsListService

See merge request gitlab-org/gitlab!27633
parents 5e05c233 bc239b55
......@@ -4,14 +4,12 @@
module Projects
module LfsPointers
class LfsListService < BaseService
REV = 'HEAD'
# Retrieve all lfs blob pointers and returns a hash
# with the structure { lfs_file_oid => lfs_file_size }
def execute
return {} unless project&.lfs_enabled?
Gitlab::Git::LfsChanges.new(project.repository, REV)
Gitlab::Git::LfsChanges.new(project.repository)
.all_pointers
.map! { |blob| [blob.lfs_oid, blob.lfs_size] }
.to_h
......
......@@ -3,7 +3,7 @@
module Gitlab
module Git
class LfsChanges
def initialize(repository, newrev)
def initialize(repository, newrev = nil)
@repository = repository
@newrev = newrev
end
......
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