diff options
author | James Lopez <james@jameslopez.es> | 2018-07-11 16:58:42 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-07-11 16:58:42 +0300 |
commit | e2b7880b9d959f71e4127b8d6eb993e27460b5d3 (patch) | |
tree | 6faed6b87ad7760be70c477942a10346cc0c87a7 /lib/gitlab/import_export | |
parent | fa2e3162f8955eaa7259c17c080a083b5d9e8ba9 (diff) |
fix spec
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r-- | lib/gitlab/import_export/uploads_manager.rb | 22 | ||||
-rw-r--r-- | lib/gitlab/import_export/uploads_restorer.rb | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/gitlab/import_export/uploads_manager.rb b/lib/gitlab/import_export/uploads_manager.rb index 6af8620ccd0..070a0cefe85 100644 --- a/lib/gitlab/import_export/uploads_manager.rb +++ b/lib/gitlab/import_export/uploads_manager.rb @@ -29,15 +29,10 @@ module Gitlab Dir["#{uploads_export_path}/**/*"].each do |upload| next if File.directory?(upload) - secret, identifier = upload.split('/').last(2) - - uploader_context = { - secret: secret, - identifier: identifier - } - - UploadService.new(@project, File.open(upload, 'r'), FileUploader, uploader_context).execute + add_upload(upload) end + + true rescue => e @shared.error(e) false @@ -45,6 +40,17 @@ module Gitlab private + def add_upload(upload) + secret, identifier = upload.split('/').last(2) + + uploader_context = { + secret: secret, + identifier: identifier + } + + UploadService.new(@project, File.open(upload, 'r'), FileUploader, uploader_context).execute + end + def copy_from_object_storage return unless Gitlab::ImportExport.object_storage? diff --git a/lib/gitlab/import_export/uploads_restorer.rb b/lib/gitlab/import_export/uploads_restorer.rb index 15714c52c1a..69c1f289797 100644 --- a/lib/gitlab/import_export/uploads_restorer.rb +++ b/lib/gitlab/import_export/uploads_restorer.rb @@ -9,6 +9,8 @@ module Gitlab ).restore elsif File.directory?(uploads_export_path) copy_files(uploads_export_path, uploads_path) + + true else true end |