Commit 0f29ccffd2b9805545db63d8266bb8367de1e35c

Authored by Jacob Vosmaer
1 parent 23ae3911

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.
Showing 2 changed files with 4 additions and 6 deletions   Show diff stats
CHANGELOG
... ... @@ -11,6 +11,7 @@ v 6.9.0
11 11 - Improve issue and merge request mobile UI (Drew Blessing)
12 12 - Document how to convert a backup to PostgreSQL
13 13 - Fix locale bug in backup manager
  14 + - Fix wiki backup skip bug
14 15  
15 16 v 6.8.0
16 17 - Ability to at mention users that are participating in issue and merge req. discussion
... ...
lib/backup/repository.rb
... ... @@ -10,15 +10,12 @@ module Backup
10 10 Project.find_each(batch_size: 1000) do |project|
11 11 print " * #{project.path_with_namespace} ... "
12 12  
13   - if project.empty_repo?
14   - puts "[SKIPPED]".cyan
15   - next
16   - end
17   -
18 13 # Create namespace dir if missing
19 14 FileUtils.mkdir_p(File.join(backup_repos_path, project.namespace.path)) if project.namespace
20 15  
21   - if system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent)
  16 + if project.empty_repo?
  17 + puts "[SKIPPED]".cyan
  18 + elsif system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent)
22 19 puts "[DONE]".green
23 20 else
24 21 puts "[FAILED]".red
... ...