Differential D19876 Diff 47472 src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php
Show All 31 Lines | foreach ($projects as $project) { | ||||
$branches = id(new ReleephBranch())->loadAllWhere( | $branches = id(new ReleephBranch())->loadAllWhere( | ||||
'releephProjectID = %d AND isActive = 1', | 'releephProjectID = %d AND isActive = 1', | ||||
$project->getID()); | $project->getID()); | ||||
foreach ($branches as $branch) { | foreach ($branches as $branch) { | ||||
$full_branch_name = $branch->getName(); | $full_branch_name = $branch->getName(); | ||||
$cut_point_commit = $branch->loadOneRelative( | $cut_point_commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( | ||||
id(new PhabricatorRepositoryCommit()), | 'phid = %s', | ||||
'phid', | $branch->getCutPointCommitPHID()); | ||||
'getCutPointCommitPHID'); | |||||
$results[] = array( | $results[] = array( | ||||
'project' => $project->getName(), | 'project' => $project->getName(), | ||||
'repository' => $repository->getCallsign(), | 'repository' => $repository->getCallsign(), | ||||
'branch' => $branch->getBasename(), | 'branch' => $branch->getBasename(), | ||||
'fullBranchName' => $full_branch_name, | 'fullBranchName' => $full_branch_name, | ||||
'symbolicName' => $branch->getSymbolicName(), | 'symbolicName' => $branch->getSymbolicName(), | ||||
'cutPoint' => $cut_point_commit->getCommitIdentifier(), | 'cutPoint' => $cut_point_commit->getCommitIdentifier(), | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
} | } |