1
0
Fork 0
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:
vrana 2012-09-05 12:10:54 -07:00
parent 492b6e7a6d
commit b3d7ed3e8e

View file

@ -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;
}