Changeset View
Changeset View
Standalone View
Standalone View
src/ref/ArcanistRepositoryRef.php
| Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | public function getDefaultBranch() { | ||||
| if ($branch === null) { | if ($branch === null) { | ||||
| return 'master'; | return 'master'; | ||||
| } | } | ||||
| return $branch; | return $branch; | ||||
| } | } | ||||
| public function isPermanentRef(ArcanistMarkerRef $ref) { | |||||
| $rules = idxv( | |||||
| $this->parameters, | |||||
| array('fields', 'refRules', 'permanentRefRules')); | |||||
| if ($rules === null) { | |||||
| return false; | |||||
| } | |||||
| // If the rules exist but there are no specified rules, treat every ref | |||||
| // as permanent. | |||||
| if (!$rules) { | |||||
| return true; | |||||
| } | |||||
| // TODO: It would be nice to unify evaluation of permanent ref rules | |||||
Lint: TODO Comment: This comment has a TODO. | |||||
| // across Arcanist and Phabricator. | |||||
| $ref_name = $ref->getName(); | |||||
| foreach ($rules as $rule) { | |||||
| $matches = null; | |||||
| if (preg_match('(^regexp\\((.*)\\)\z)', $rule, $matches)) { | |||||
| if (preg_match($matches[1], $ref_name)) { | |||||
| return true; | |||||
| } | |||||
| } else { | |||||
| if ($rule === $ref_name) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| } | } | ||||
This comment has a TODO.