BigW Consortium Gitlab

Prefer user email match when looking for commit author

parent 89315311
......@@ -125,7 +125,9 @@ module CommitsHelper
source_name
end
user = User.where('name like ? or email like ?', source_name, source_email).first
# Prefer email match over name match
user = User.where(email: source_email).first
user ||= User.where(name: source_name).first
options = {
class: "commit-#{options[:source]}-link has_tooltip",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment