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:
authorAchilleas Pipinellis <axilleas@axilleas.me>2014-11-29 22:59:28 +0300
committerAchilleas Pipinellis <axilleas@axilleas.me>2014-11-29 23:01:52 +0300
commit880478b21e7c9b0068b3e14b8f7fb58ada2c232e (patch)
tree1b3cd842c0c18c59002a7dac11b11abfaf2d96a7 /lib/backup/repository.rb
parent27cd35de697ad42781cc4bdb0209f1f331a2591b (diff)
Proper wiki restore. Fixes #845
Diffstat (limited to 'lib/backup/repository.rb')
-rw-r--r--lib/backup/repository.rb20
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