Commit 1a45de3d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'post_receive-any-email' into 'master'

post_receive: accept any user email from last commit

See merge request !7225
parents ba0d4877 b9176afb
---
title: "post_receive: accept any user email from last commit"
merge_request: 7225
author: Elan Ruusamäe
...@@ -24,7 +24,7 @@ module Gitlab ...@@ -24,7 +24,7 @@ module Gitlab
email = commit.author_email email = commit.author_email
identify_with_cache(:email, email) do identify_with_cache(:email, email) do
User.find_by(email: email) User.find_by_any_email(email)
end end
end end
......
...@@ -65,7 +65,7 @@ describe Gitlab::Identifier do ...@@ -65,7 +65,7 @@ describe Gitlab::Identifier do
commit = double(:commit, author_email: user.email) commit = double(:commit, author_email: user.email)
expect(project).to receive(:commit).with('123').twice.and_return(commit) expect(project).to receive(:commit).with('123').twice.and_return(commit)
expect(User).to receive(:find_by).once.and_call_original expect(User).to receive(:find_by_any_email).once.and_call_original
2.times do 2.times do
expect(identifier.identify_using_commit(project, '123')).to eq(user) expect(identifier.identify_using_commit(project, '123')).to eq(user)
......
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