Path: blob/master/src/applications/diffusion/remarkup/DiffusionCommitRemarkupRule.php
12241 views
<?php12final class DiffusionCommitRemarkupRule extends PhabricatorObjectRemarkupRule {34protected function getObjectNamePrefix() {5return '';6}78protected function getObjectNamePrefixBeginsWithWordCharacter() {9return true;10}1112protected function getObjectIDPattern() {13return PhabricatorRepositoryCommitPHIDType::getCommitObjectNamePattern();14}1516protected function getObjectNameText(17$object,18PhabricatorObjectHandle $handle,19$id) {2021// If this commit is unreachable, return the handle name instead of the22// normal text because it may be able to tell the user that the commit23// was rewritten and where to find the new one.2425// By default, we try to preserve what the user actually typed as26// faithfully as possible, but if they're referencing a deleted commit27// it's more valuable to try to pick up any rewrite. See T11522.28if ($object->isUnreachable()) {29return $handle->getName();30}3132return parent::getObjectNameText($object, $handle, $id);33}3435protected function loadObjects(array $ids) {36$viewer = $this->getEngine()->getConfig('viewer');3738$query = id(new DiffusionCommitQuery())39->setViewer($viewer)40->withIdentifiers($ids);4142$query->execute();43return $query->getIdentifierMap();44}4546}474849