diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-03-30 19:45:58 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-05 10:21:51 +0200 |
commit | 79cb4d99c0e47bfd988788ff38871e668367dfbf (patch) | |
tree | ed690679d2b74f8e3e37f68b877cc80f13b99e12 /lib/gitlab/import_export/importer.rb | |
parent | 84ee2ddbcd850d29ae852333c57e2e8381f5a535 (diff) | |
download | gitlab-ce-79cb4d99c0e47bfd988788ff38871e668367dfbf.tar.gz |
Import projects with LFS objects
If the LFS object already exist, we'll link it tot he existing one, if
not we'll create it.
Diffstat (limited to 'lib/gitlab/import_export/importer.rb')
-rw-r--r-- | lib/gitlab/import_export/importer.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/importer.rb b/lib/gitlab/import_export/importer.rb index c38df9102eb..c490bf059d2 100644 --- a/lib/gitlab/import_export/importer.rb +++ b/lib/gitlab/import_export/importer.rb @@ -13,7 +13,7 @@ module Gitlab end def execute - if import_file && check_version! && [repo_restorer, wiki_restorer, project_tree, avatar_restorer, uploads_restorer].all?(&:restore) + if import_file && check_version! && restorers.all?(&:restore) project_tree.restored_project else raise Projects::ImportService::Error.new(@shared.errors.join(', ')) @@ -24,6 +24,11 @@ module Gitlab private + def restorers + [repo_restorer, wiki_restorer, project_tree, avatar_restorer, + uploads_restorer, lfs_restorer] + end + def import_file Gitlab::ImportExport::FileImporter.import(archive_file: @archive_file, shared: @shared) @@ -60,6 +65,10 @@ module Gitlab Gitlab::ImportExport::UploadsRestorer.new(project: project_tree.restored_project, shared: @shared) end + def lfs_restorer + Gitlab::ImportExport::LfsRestorer.new(project: project_tree.restored_project, shared: @shared) + end + def path_with_namespace File.join(@project.namespace.full_path, @project.path) end |