Differential D18693 Diff 44881 src/applications/repository/data/PhabricatorRepositoryURINormalizer.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/data/PhabricatorRepositoryURINormalizer.php
Show All 21 Lines | |||||
* $norm_b = new PhabricatorRepositoryURINormalizer($type, $uri_b); | * $norm_b = new PhabricatorRepositoryURINormalizer($type, $uri_b); | ||||
* | * | ||||
* if ($norm_a->getNormalizedPath() == $norm_b->getNormalizedPath()) { | * if ($norm_a->getNormalizedPath() == $norm_b->getNormalizedPath()) { | ||||
* // URIs appear to point at the same repository. | * // URIs appear to point at the same repository. | ||||
* } else { | * } else { | ||||
* // URIs are very unlikely to be the same repository. | * // URIs are very unlikely to be the same repository. | ||||
* } | * } | ||||
* | * | ||||
* Because a repository can be hosted at arbitrarly many arbitrary URIs, there | * Because a repository can be hosted at arbitrarily many arbitrary URIs, there | ||||
* is no way to completely prevent false negatives by only examining URIs | * is no way to completely prevent false negatives by only examining URIs | ||||
* (that is, repositories with totally different URIs could really be the same). | * (that is, repositories with totally different URIs could really be the same). | ||||
* However, normalization is relatively agressive and false negatives should | * However, normalization is relatively aggressive and false negatives should | ||||
* be rare: if normalization says two URIs are different repositories, they | * be rare: if normalization says two URIs are different repositories, they | ||||
* probably are. | * probably are. | ||||
* | * | ||||
* @task normal Normalizing URIs | * @task normal Normalizing URIs | ||||
*/ | */ | ||||
final class PhabricatorRepositoryURINormalizer extends Phobject { | final class PhabricatorRepositoryURINormalizer extends Phobject { | ||||
const TYPE_GIT = 'git'; | const TYPE_GIT = 'git'; | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |