diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-07-07 16:19:32 +0400 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-07-07 16:19:32 +0400 |
commit | 553f3aba48e7b124b02b0a7eecd85eacec7453e3 (patch) | |
tree | 8ce43888679167b6c77def464553a94d7cb7c325 /lib/tasks | |
parent | 4c68d2387e51632e9808ed3a0db9f6dc14e25b31 (diff) |
Remove duplicated calls.
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/check.rake | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 84f0cf8ef21..28fc56591cb 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -216,12 +216,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - message = if sanitize - "#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... " - else - "#{project.name_with_namespace.yellow} ... " - end - print message + print sanitized_message(project) if project.satellite.exists? puts "yes".green @@ -530,12 +525,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - message = if sanitize - "#{project.id.to_s.yellow} ... " - else - "#{project.name_with_namespace.yellow} ... " - end - print message + print sanitized_message(project) if project.empty_repo? puts "repository is empty".magenta @@ -598,12 +588,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - message = if sanitize - "#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... " - else - "#{project.name_with_namespace.yellow} ... " - end - print message + print sanitized_message(project) if project.namespace puts "yes".green @@ -853,6 +838,14 @@ namespace :gitlab do Dir.pwd == '/opt/gitlab/embedded/service/gitlab-rails' end + def sanitized_message(project) + if sanitize + "#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... " + else + "#{project.name_with_namespace.yellow} ... " + end + end + def sanitize if ENV['SANITIZE'] == "true" true |