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:
Diffstat (limited to 'lib/gitlab/github_import/user_finder.rb')
-rw-r--r--lib/gitlab/github_import/user_finder.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/gitlab/github_import/user_finder.rb b/lib/gitlab/github_import/user_finder.rb
index 058cd1ebd57..f583ef39d13 100644
--- a/lib/gitlab/github_import/user_finder.rb
+++ b/lib/gitlab/github_import/user_finder.rb
@@ -120,10 +120,18 @@ module Gitlab
read_id_from_cache(ID_FOR_EMAIL_CACHE_KEY % email)
end
- # Queries and caches the GitLab user ID for a GitHub user ID, if one was
- # found.
+ # If importing from github.com, queries and caches the GitLab user ID for
+ # a GitHub user ID, if one was found.
+ #
+ # When importing from Github Enterprise, do not query user by Github ID
+ # since we only have users' Github ID from github.com.
def id_for_github_id(id)
- gitlab_id = query_id_for_github_id(id) || nil
+ gitlab_id =
+ if project.github_enterprise_import?
+ nil
+ else
+ query_id_for_github_id(id)
+ end
Gitlab::Cache::Import::Caching.write(ID_CACHE_KEY % id, gitlab_id)
end