summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/importer/lfs_object_importer.rb
blob: a88c17aaf824f2805ba5cee38b29cd6cb6146f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Gitlab
  module GithubImport
    module Importer
      class LfsObjectImporter
        attr_reader :lfs_object, :project

        # lfs_object - An instance of `Gitlab::GithubImport::Representation::LfsObject`.
        # project - An instance of `Project`.
        def initialize(lfs_object, project, _)
          @lfs_object = lfs_object
          @project = project
        end

        def execute
          Projects::LfsPointers::LfsDownloadService
            .new(project)
            .execute(lfs_object.oid, lfs_object.download_link)
        end
      end
    end
  end
end