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:
authorDongqing Hu <sorra@outlook.com>2017-03-29 14:45:15 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-03-29 14:45:15 +0300
commit6dd76954443180e8fe97950e230ea6d1e2400d65 (patch)
treea3ada4ea616e2aaabed3a25a9960f19bd59b99e3 /lib/gitlab/bitbucket_import
parentb0e18eaf87e446caa075ba56c0e805b514206e10 (diff)
Labels support color names in backend
Diffstat (limited to 'lib/gitlab/bitbucket_import')
-rw-r--r--lib/gitlab/bitbucket_import/importer.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb
index 44323b47dca..f4efa20374a 100644
--- a/lib/gitlab/bitbucket_import/importer.rb
+++ b/lib/gitlab/bitbucket_import/importer.rb
@@ -130,8 +130,13 @@ module Gitlab
end
def create_labels
- LABELS.each do |label|
- @labels[label[:title]] = project.labels.create!(label)
+ LABELS.each do |label_params|
+ label = ::Labels::CreateService.new(label_params).execute(project: project)
+ if label.valid?
+ @labels[label_params[:title]] = label
+ else
+ raise "Failed to create label \"#{label_params[:title]}\" for project \"#{project.name_with_namespace}\""
+ end
end
end