Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionRequest.php
Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | public function loadCoverage() { | ||||
return idx($coverage_row, 'coverage'); | return idx($coverage_row, 'coverage'); | ||||
} | } | ||||
public function loadCommit() { | public function loadCommit() { | ||||
if (empty($this->repositoryCommit)) { | if (empty($this->repositoryCommit)) { | ||||
$repository = $this->getRepository(); | $repository = $this->getRepository(); | ||||
// TODO: (T603) This should be a real query, but we need to sort out | $commit = id(new DiffusionCommitQuery()) | ||||
// the viewer. | ->setViewer($this->getUser()) | ||||
$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( | ->withRepositoryIDs(array($repository->getID())) | ||||
'repositoryID = %d AND commitIdentifier = %s', | ->withIdentifiers(array($this->getStableCommit())) | ||||
$repository->getID(), | ->executeOne(); | ||||
$this->getStableCommit()); | |||||
if ($commit) { | if ($commit) { | ||||
$commit->attachRepository($repository); | $commit->attachRepository($repository); | ||||
} | } | ||||
$this->repositoryCommit = $commit; | $this->repositoryCommit = $commit; | ||||
} | } | ||||
return $this->repositoryCommit; | return $this->repositoryCommit; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines |