Commit e2b7880b authored by James Lopez's avatar James Lopez

fix spec

parent fa2e3162
...@@ -29,15 +29,10 @@ module Gitlab ...@@ -29,15 +29,10 @@ module Gitlab
Dir["#{uploads_export_path}/**/*"].each do |upload| Dir["#{uploads_export_path}/**/*"].each do |upload|
next if File.directory?(upload) next if File.directory?(upload)
secret, identifier = upload.split('/').last(2) add_upload(upload)
uploader_context = {
secret: secret,
identifier: identifier
}
UploadService.new(@project, File.open(upload, 'r'), FileUploader, uploader_context).execute
end end
true
rescue => e rescue => e
@shared.error(e) @shared.error(e)
false false
...@@ -45,6 +40,17 @@ module Gitlab ...@@ -45,6 +40,17 @@ module Gitlab
private 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 def copy_from_object_storage
return unless Gitlab::ImportExport.object_storage? return unless Gitlab::ImportExport.object_storage?
......
...@@ -9,6 +9,8 @@ module Gitlab ...@@ -9,6 +9,8 @@ module Gitlab
).restore ).restore
elsif File.directory?(uploads_export_path) elsif File.directory?(uploads_export_path)
copy_files(uploads_export_path, uploads_path) copy_files(uploads_export_path, uploads_path)
true
else else
true true
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment