diff options
author | Andreas Kämmerle <andreas.kaemmerle@gmail.com> | 2018-09-13 12:00:59 +0200 |
---|---|---|
committer | Andreas Kämmerle <andreas.kaemmerle@gmail.com> | 2018-09-13 12:00:59 +0200 |
commit | 87d01cc3bfc12c08024881dc8f13101e5430e3e6 (patch) | |
tree | 05e82defa51500257f97e3530862da03668895e3 /lib/gitlab/import_export/uploads_manager.rb | |
parent | fef5c923c009c64183cc43909444a1bdaba218b7 (diff) | |
parent | 71f3d48544cc0857c8d470b182f7e809de6a4642 (diff) | |
download | gitlab-ce-87d01cc3bfc12c08024881dc8f13101e5430e3e6.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into consolidate-page-widths-part02consolidate-page-widths-part02
Diffstat (limited to 'lib/gitlab/import_export/uploads_manager.rb')
-rw-r--r-- | lib/gitlab/import_export/uploads_manager.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/gitlab/import_export/uploads_manager.rb b/lib/gitlab/import_export/uploads_manager.rb index e0d4235e65b..8511319cb1c 100644 --- a/lib/gitlab/import_export/uploads_manager.rb +++ b/lib/gitlab/import_export/uploads_manager.rb @@ -5,18 +5,13 @@ module Gitlab UPLOADS_BATCH_SIZE = 100 - def initialize(project:, shared:, relative_export_path: 'uploads', from: nil) + def initialize(project:, shared:, relative_export_path: 'uploads') @project = project @shared = shared @relative_export_path = relative_export_path - @from = from || default_uploads_path end def save - if File.file?(@from) && @relative_export_path == 'avatar' - copy_files(@from, File.join(uploads_export_path, @project.avatar.filename)) - end - copy_project_uploads true @@ -55,17 +50,11 @@ module Gitlab copy_files(uploader.absolute_path, File.join(uploads_export_path, uploader.upload.path)) else - next unless Gitlab::ImportExport.object_storage? - download_and_copy(uploader) end end end - def default_uploads_path - FileUploader.absolute_base_dir(@project) - end - def uploads_export_path @uploads_export_path ||= File.join(@shared.export_path, @relative_export_path) end |