Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/import_export/file_importer.rb')
-rw-r--r--lib/gitlab/import_export/file_importer.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/gitlab/import_export/file_importer.rb b/lib/gitlab/import_export/file_importer.rb
index 51d58aae54f..4b3258f8caa 100644
--- a/lib/gitlab/import_export/file_importer.rb
+++ b/lib/gitlab/import_export/file_importer.rb
@@ -33,7 +33,7 @@ module Gitlab
validate_decompressed_archive_size if Feature.enabled?(:validate_import_decompressed_archive_size)
decompress_archive
end
- rescue => e
+ rescue StandardError => e
@shared.error(e)
false
ensure
@@ -57,7 +57,7 @@ module Gitlab
def decompress_archive
result = untar_zxf(archive: @archive_file, dir: @shared.export_path)
- raise ImporterError.new("Unable to decompress #{@archive_file} into #{@shared.export_path}") unless result
+ raise ImporterError, "Unable to decompress #{@archive_file} into #{@shared.export_path}" unless result
result
end
@@ -67,7 +67,17 @@ module Gitlab
@archive_file = File.join(@shared.archive_path, Gitlab::ImportExport.export_filename(exportable: @importable))
- download_or_copy_upload(@importable.import_export_upload.import_file, @archive_file)
+ remote_download_or_download_or_copy_upload
+ end
+
+ def remote_download_or_download_or_copy_upload
+ import_export_upload = @importable.import_export_upload
+
+ if import_export_upload.remote_import_url.present?
+ download(import_export_upload.remote_import_url, @archive_file)
+ else
+ download_or_copy_upload(import_export_upload.import_file, @archive_file)
+ end
end
def remove_symlinks
@@ -87,7 +97,7 @@ module Gitlab
end
def validate_decompressed_archive_size
- raise ImporterError.new(_('Decompressed archive size validation failed.')) unless size_validator.valid?
+ raise ImporterError, _('Decompressed archive size validation failed.') unless size_validator.valid?
end
def size_validator