summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-19 15:37:21 +0200
committerJames Lopez <james@jameslopez.es>2016-05-19 15:37:21 +0200
commit7df495fb7702f3635d6746cb9b0d79d00eafed80 (patch)
tree5d388628addcd77a096a336bcd6240c2058e331e
parent816dfcb1c54277ce5e3e3da1a0c1028b4c2cdb3c (diff)
downloadgitlab-ce-7df495fb7702f3635d6746cb9b0d79d00eafed80.tar.gz
updated uploads saver
-rw-r--r--lib/gitlab/import_export/uploads_saver.rb11
1 files 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