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
path: root/lib/tasks
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-07-07 16:19:32 +0400
committerMarin Jankovski <marin@gitlab.com>2014-07-07 16:19:32 +0400
commit553f3aba48e7b124b02b0a7eecd85eacec7453e3 (patch)
tree8ce43888679167b6c77def464553a94d7cb7c325 /lib/tasks
parent4c68d2387e51632e9808ed3a0db9f6dc14e25b31 (diff)
Remove duplicated calls.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/check.rake29
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