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:
authorRémy Coutable <remy@rymai.me>2016-12-16 19:44:22 +0300
committerRémy Coutable <remy@rymai.me>2016-12-19 19:35:51 +0300
commitab06313c36fc5856b2472d3dfcb966a8c6341d0b (patch)
treeea6d499de443ada8364337c194e1d08b4e28682f /lib/gitlab/github_import
parente046e4c14d06a19cc30a679f4943c77b56ee6d0c (diff)
Add Project#gitea_import?
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r--lib/gitlab/github_import/importer.rb6
-rw-r--r--lib/gitlab/github_import/milestone_formatter.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb
index c53cd1a928d..ec1318ab33c 100644
--- a/lib/gitlab/github_import/importer.rb
+++ b/lib/gitlab/github_import/importer.rb
@@ -22,7 +22,7 @@ module Gitlab
opts = {}
# Gitea plan to be GitHub compliant
- if project.import_type == 'gitea'
+ if project.gitea_import?
uri = URI.parse(project.import_url)
host = "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}".sub(%r{/?[\w-]+/[\w-]+\.git\z}, '')
opts = {
@@ -53,7 +53,7 @@ module Gitlab
# Gitea doesn't have a Release API yet
# See https://github.com/go-gitea/gitea/issues/330
- unless project.import_type == 'gitea'
+ unless project.gitea_import?
import_releases
end
@@ -141,7 +141,7 @@ module Gitlab
merge_request = gh_pull_request.create!
# Gitea doesn't return PR in the Issue API endpoint, so labels must be assigned at this stage
- if project.import_type == 'gitea'
+ if project.gitea_import?
apply_labels(merge_request, raw)
end
rescue => e
diff --git a/lib/gitlab/github_import/milestone_formatter.rb b/lib/gitlab/github_import/milestone_formatter.rb
index fe172b854d5..dd782eff059 100644
--- a/lib/gitlab/github_import/milestone_formatter.rb
+++ b/lib/gitlab/github_import/milestone_formatter.rb
@@ -23,7 +23,7 @@ module Gitlab
end
def number
- if project.import_type == 'gitea'
+ if project.gitea_import?
raw_data.id
else
raw_data.number