Differential D15986 Diff 38488 src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | private function resolveGitRefs() { | ||||
| $repository = $this->getRepository(); | $repository = $this->getRepository(); | ||||
| $unresolved = array_fuse($this->refs); | $unresolved = array_fuse($this->refs); | ||||
| $results = array(); | $results = array(); | ||||
| // First, resolve branches and tags. | // First, resolve branches and tags. | ||||
| $ref_map = id(new DiffusionLowLevelGitRefQuery()) | $ref_map = id(new DiffusionLowLevelGitRefQuery()) | ||||
| ->setRepository($repository) | ->setRepository($repository) | ||||
| ->withIsTag(true) | ->withRefTypes( | ||||
| ->withIsOriginBranch(true) | array( | ||||
| PhabricatorRepositoryRefCursor::TYPE_BRANCH, | |||||
| PhabricatorRepositoryRefCursor::TYPE_TAG, | |||||
| )) | |||||
| ->execute(); | ->execute(); | ||||
| $ref_map = mgroup($ref_map, 'getShortName'); | $ref_map = mgroup($ref_map, 'getShortName'); | ||||
| $tag_prefix = 'refs/tags/'; | $tag_prefix = 'refs/tags/'; | ||||
| foreach ($unresolved as $ref) { | foreach ($unresolved as $ref) { | ||||
| if (empty($ref_map[$ref])) { | if (empty($ref_map[$ref])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines | |||||