@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 36 lines 838 B view raw
1<?php 2 3final class DiffusionCommitBranchesHeraldField 4 extends DiffusionCommitHeraldField { 5 6 const FIELDCONST = 'diffusion.commit.branches'; 7 8 public function getHeraldFieldName() { 9 return pht('Branches'); 10 } 11 12 public function getHeraldFieldValue($object) { 13 $viewer = $this->getAdapter()->getViewer(); 14 15 $commit = $object; 16 $repository = $object->getRepository(); 17 18 $params = array( 19 'repository' => $repository->getPHID(), 20 'contains' => $commit->getCommitIdentifier(), 21 ); 22 23 $result = id(new ConduitCall('diffusion.branchquery', $params)) 24 ->setUser($viewer) 25 ->execute(); 26 27 $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result); 28 29 return mpull($refs, 'getShortName'); 30 } 31 32 protected function getHeraldFieldStandardType() { 33 return self::STANDARD_TEXT_LIST; 34 } 35 36}