Differential D11050 Diff 26601 src/applications/repository/phid/PhabricatorRepositoryCommitPHIDType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/phid/PhabricatorRepositoryCommitPHIDType.php
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public function loadHandles( | ||||
} | } | ||||
} | } | ||||
public static function getCommitObjectNamePattern() { | public static function getCommitObjectNamePattern() { | ||||
$min_unqualified = PhabricatorRepository::MINIMUM_UNQUALIFIED_HASH; | $min_unqualified = PhabricatorRepository::MINIMUM_UNQUALIFIED_HASH; | ||||
$min_qualified = PhabricatorRepository::MINIMUM_QUALIFIED_HASH; | $min_qualified = PhabricatorRepository::MINIMUM_QUALIFIED_HASH; | ||||
return | return | ||||
'r[A-Z]+[1-9]\d*'. | 'r([A-Z]+:?|[0-9]+:)[1-9]\d*'. | ||||
'|'. | '|'. | ||||
'r[A-Z]+[a-f0-9]{'.$min_qualified.',40}'. | 'r([A-Z]+:?|[0-9]+:)[a-f0-9]{'.$min_qualified.',40}'. | ||||
'|'. | '|'. | ||||
'[a-f0-9]{'.$min_unqualified.',40}'; | '[a-f0-9]{'.$min_unqualified.',40}'; | ||||
} | } | ||||
public function canLoadNamedObject($name) { | public function canLoadNamedObject($name) { | ||||
$pattern = self::getCommitObjectNamePattern(); | $pattern = self::getCommitObjectNamePattern(); | ||||
return preg_match('(^'.$pattern.'$)', $name); | return preg_match('(^'.$pattern.'$)', $name); | ||||
} | } | ||||
Show All 15 Lines |