diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2014-11-29 21:59:28 +0200 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2014-11-29 22:01:52 +0200 |
commit | 880478b21e7c9b0068b3e14b8f7fb58ada2c232e (patch) | |
tree | 1b3cd842c0c18c59002a7dac11b11abfaf2d96a7 /lib/backup | |
parent | 27cd35de697ad42781cc4bdb0209f1f331a2591b (diff) | |
download | gitlab-ce-880478b21e7c9b0068b3e14b8f7fb58ada2c232e.tar.gz |
Proper wiki restore. Fixes #845
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/repository.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index f39fba23cf5..6b04b23cf46 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -79,16 +79,20 @@ module Backup wiki = ProjectWiki.new(project) + $progress.print " * #{wiki.path_with_namespace} ... " + if File.exists?(path_to_bundle(wiki)) - $progress.print " * #{wiki.path_with_namespace} ... " cmd = %W(git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)}) - if system(*cmd, silent) - $progress.puts " [DONE]".green - else - puts " [FAILED]".red - puts "failed: #{cmd.join(' ')}" - abort 'Restore failed' - end + else + cmd = %W(git init --bare #{path_to_repo(wiki)}) + end + + if system(*cmd, silent) + $progress.puts " [DONE]".green + else + puts " [FAILED]".red + puts "failed: #{cmd.join(' ')}" + abort 'Restore failed' end end |