Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/storage/PhabricatorOwnersPath.php
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | final class PhabricatorOwnersPath extends PhabricatorOwnersDAO { | ||||
| } | } | ||||
| public static function isRefInSet(array $ref, array $set) { | public static function isRefInSet(array $ref, array $set) { | ||||
| $key = self::getScalarKeyForRef($ref); | $key = self::getScalarKeyForRef($ref); | ||||
| return isset($set[$key]); | return isset($set[$key]); | ||||
| } | } | ||||
| private static function getScalarKeyForRef(array $ref) { | private static function getScalarKeyForRef(array $ref) { | ||||
| // See T13464. When building refs from raw transactions, the path has | |||||
| // not been normalized yet and doesn't have a separate "display" path. | |||||
| // If the "display" path isn't populated, just use the actual path to | |||||
| // build the ref key. | |||||
| if (isset($ref['display'])) { | |||||
| $display = $ref['display']; | |||||
| } else { | |||||
| $display = $ref['path']; | |||||
| } | |||||
| return sprintf( | return sprintf( | ||||
| 'repository=%s path=%s display=%s excluded=%d', | 'repository=%s path=%s display=%s excluded=%d', | ||||
| $ref['repositoryPHID'], | $ref['repositoryPHID'], | ||||
| $ref['path'], | $ref['path'], | ||||
| $ref['display'], | $display, | ||||
| $ref['excluded']); | $ref['excluded']); | ||||
| } | } | ||||
| /** | /** | ||||
| * Get the number of directory matches between this path specification and | * Get the number of directory matches between this path specification and | ||||
| * some real path. | * some real path. | ||||
| */ | */ | ||||
| Show All 31 Lines | |||||