summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-08 22:49:27 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-08 22:50:48 +0200
commit0f29ccffd2b9805545db63d8266bb8367de1e35c (patch)
treeef27d25fef52d687c1e299d4ba8508a2a4fd26a3 /lib
parent23ae3911aa55f075e30da9da4e687e064e59a9fa (diff)
downloadgitlab-ce-0f29ccffd2b9805545db63d8266bb8367de1e35c.tar.gz
Backup wiki repo even if the main repo is empty
This fixes a bug where wiki repositories for projects with an empty main repository would not get backed up.
Diffstat (limited to 'lib')
-rw-r--r--lib/backup/repository.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index 214d9824ee1..6f7c4f7c909 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -10,15 +10,12 @@ module Backup
Project.find_each(batch_size: 1000) do |project|
print " * #{project.path_with_namespace} ... "
- if project.empty_repo?
- puts "[SKIPPED]".cyan
- next
- end
-
# Create namespace dir if missing
FileUtils.mkdir_p(File.join(backup_repos_path, project.namespace.path)) if project.namespace
- if system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent)
+ if project.empty_repo?
+ puts "[SKIPPED]".cyan
+ elsif system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent)
puts "[DONE]".green
else
puts "[FAILED]".red