Differential D8098 Diff 18348 src/applications/repository/data/PhabricatorRepositoryURINormalizer.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/data/PhabricatorRepositoryURINormalizer.php
| Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | switch ($this->type) { | ||||
| case self::TYPE_GIT: | case self::TYPE_GIT: | ||||
| $path = preg_replace('/\.git$/', '', $path); | $path = preg_replace('/\.git$/', '', $path); | ||||
| break; | break; | ||||
| case self::TYPE_SVN: | case self::TYPE_SVN: | ||||
| case self::TYPE_MERCURIAL: | case self::TYPE_MERCURIAL: | ||||
| break; | break; | ||||
| } | } | ||||
| // If this is a Phabricator URI, strip it down to the callsign. We mutably | |||||
| // allow you to clone repositories as "/diffusion/X/anything.git", for | |||||
| // example. | |||||
| $matches = null; | |||||
| if (preg_match('@^(diffusion/[A-Z]+)@', $path, $matches)) { | |||||
| $path = $matches[1]; | |||||
| } | |||||
| return $path; | return $path; | ||||
| } | } | ||||
| } | } | ||||