summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/uploads_manager.rb
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2018-09-11 08:43:10 +0200
committerMartin Wortschack <mwortschack@gitlab.com>2018-09-11 08:43:10 +0200
commita2f7936c74e6c9c4eed7b1c5641f0c43d4ff1375 (patch)
tree82b1ea27fe2a9a1be884467e10d9bde688ce97d1 /lib/gitlab/import_export/uploads_manager.rb
parentbfd2181310097f5c0a92a43ffc2b7b9540b96ad3 (diff)
parent2f990e3408d00cad473d8dcf8a4e49155cc3cc33 (diff)
downloadgitlab-ce-a2f7936c74e6c9c4eed7b1c5641f0c43d4ff1375.tar.gz
merge master and resolve conflicts
Diffstat (limited to 'lib/gitlab/import_export/uploads_manager.rb')
-rw-r--r--lib/gitlab/import_export/uploads_manager.rb13
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