summaryrefslogtreecommitdiff
path: root/lib/gitlab/bitbucket_server_import/importer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/bitbucket_server_import/importer.rb')
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index e0eee64dc58..899e2e6c1c5 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -461,10 +461,14 @@ module Gitlab
end
def uid(rep_object)
- find_user_id(by: :email, value: rep_object.author_email) unless Feature.enabled?(:bitbucket_server_user_mapping_by_username)
-
- find_user_id(by: :username, value: rep_object.author_username) ||
+ # We want this explicit to only be username on the FF
+ # Otherwise, match email.
+ # There should be no default fall-through on username. Fall-through to import user
+ if Feature.enabled?(:bitbucket_server_user_mapping_by_username)
+ find_user_id(by: :username, value: rep_object.author_username)
+ else
find_user_id(by: :email, value: rep_object.author_email)
+ end
end
end
end