1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Don't send a blank "COMMITS" field for mark-committed revisions.

This commit is contained in:
epriestley 2011-04-10 14:36:04 -07:00
parent 24d01d39c6
commit 689eb11ff3

View file

@ -111,20 +111,22 @@ class DifferentialCommentMail extends DifferentialMail {
$revision = $this->getRevision();
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
$phids = $revision->loadCommitPHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
if (count($handles) == 1) {
$body[] = "COMMIT";
} else {
// This is unlikely to ever happen since we'll send this mail the first
// time we discover a commit, but it's not impossible if data was
// migrated, etc.
$body[] = "COMMITS";
}
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
if (count($handles) == 1) {
$body[] = "COMMIT";
} else {
// This is unlikely to ever happen since we'll send this mail the
// first time we discover a commit, but it's not impossible if data
// was migrated, etc.
$body[] = "COMMITS";
}
foreach ($handles as $handle) {
$body[] = ' '.PhabricatorEnv::getProductionURI($handle->getURI());
foreach ($handles as $handle) {
$body[] = ' '.PhabricatorEnv::getProductionURI($handle->getURI());
}
$body[] = null;
}
$body[] = null;
}
return implode("\n", $body);