Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/engine/PhabricatorRepositoryEngine.php
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | abstract class PhabricatorRepositoryEngine { | ||||
| */ | */ | ||||
| protected function verifyGitOrigin(PhabricatorRepository $repository) { | protected function verifyGitOrigin(PhabricatorRepository $repository) { | ||||
| list($remotes) = $repository->execxLocalCommand( | list($remotes) = $repository->execxLocalCommand( | ||||
| 'remote show -n origin'); | 'remote show -n origin'); | ||||
| $matches = null; | $matches = null; | ||||
| if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) { | if (!preg_match('/^\s*Fetch URL:\s*(.*?)\s*$/m', $remotes, $matches)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Expected 'Fetch URL' in 'git remote show -n origin'."); | pht( | ||||
| "Expected '%s' in '%s'.", | |||||
| 'Fetch URL', | |||||
| 'git remote show -n origin')); | |||||
| } | } | ||||
| $remote_uri = $matches[1]; | $remote_uri = $matches[1]; | ||||
| $expect_remote = $repository->getRemoteURI(); | $expect_remote = $repository->getRemoteURI(); | ||||
| if ($remote_uri == 'origin') { | if ($remote_uri == 'origin') { | ||||
| // If a remote does not exist, git pretends it does and prints out a | // If a remote does not exist, git pretends it does and prints out a | ||||
| // made up remote where the URI is the same as the remote name. This is | // made up remote where the URI is the same as the remote name. This is | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||