Skip to content

Commit 8ddb064

Browse files
committed
Prefer user email match when looking for commit author
Signed-off-by: Dmitriy Zaporozhets <[email protected]>
1 parent 8931531 commit 8ddb064

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/helpers/commits_helper.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def commit_person_link(commit, options = {})
125125
source_name
126126
end
127127

128-
user = User.where('name like ? or email like ?', source_name, source_email).first
128+
# Prefer email match over name match
129+
user = User.where(email: source_email).first
130+
user ||= User.where(name: source_name).first
129131

130132
options = {
131133
class: "commit-#{options[:source]}-link has_tooltip",

0 commit comments

Comments
 (0)