From 7df495fb7702f3635d6746cb9b0d79d00eafed80 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 19 May 2016 15:37:21 +0200 Subject: [PATCH] updated uploads saver --- lib/gitlab/import_export/uploads_saver.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/import_export/uploads_saver.rb b/lib/gitlab/import_export/uploads_saver.rb index 7bce4ddd4e5..93bc626b363 100644 --- a/lib/gitlab/import_export/uploads_saver.rb +++ b/lib/gitlab/import_export/uploads_saver.rb @@ -14,15 +14,20 @@ module Gitlab def save return true unless File.directory?(uploads_path) - FileUtils.copy_entry(uploads_path, uploads_export_path) - true + copy_files(uploads_path, uploads_export_path) rescue => e - @shared.error(e.message) + @shared.error(e) false end private + def copy_files(source, destination) + FileUtils.mkdir_p(destination) + FileUtils.copy_entry(source, destination) + true + end + def uploads_export_path File.join(@shared.export_path, 'uploads') end