fix spec
This commit is contained in:
parent
fa2e3162f8
commit
e2b7880b9d
2 changed files with 16 additions and 8 deletions
|
@ -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?
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ module Gitlab
|
|||
).restore
|
||||
elsif File.directory?(uploads_export_path)
|
||||
copy_files(uploads_export_path, uploads_path)
|
||||
|
||||
true
|
||||
else
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue