mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Respect users with duplicate real names in commit parser
Test Plan: $parser->resolveUserPHID('Lei Zhao'); $parser->resolveUserPHID('Jakub Vrana'); Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3437
This commit is contained in:
parent
492b6e7a6d
commit
b3d7ed3e8e
1 changed files with 4 additions and 4 deletions
|
@ -97,11 +97,11 @@ abstract class PhabricatorRepositoryCommitMessageDetailParser {
|
|||
private function findUserByRealName($real_name) {
|
||||
// Note, real names are not guaranteed unique, which is why we do it this
|
||||
// way.
|
||||
$by_realname = id(new PhabricatorUser())->loadOneWhere(
|
||||
'realName = %s LIMIT 1',
|
||||
$by_realname = id(new PhabricatorUser())->loadAllWhere(
|
||||
'realName = %s',
|
||||
$real_name);
|
||||
if ($by_realname) {
|
||||
return $by_realname->getPHID();
|
||||
if (count($by_realname) == 1) {
|
||||
return reset($by_realname)->getPHID();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue