Differential D20421 Diff 48774 src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
| Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | try { | ||||
| if (!$repository->isHosted()) { | if (!$repository->isHosted()) { | ||||
| $this->logPull( | $this->logPull( | ||||
| pht( | pht( | ||||
| 'Updating the working copy for repository "%s".', | 'Updating the working copy for repository "%s".', | ||||
| $repository->getDisplayName())); | $repository->getDisplayName())); | ||||
| if ($is_git) { | if ($is_git) { | ||||
| $this->verifyGitOrigin($repository); | |||||
| $this->executeGitUpdate(); | $this->executeGitUpdate(); | ||||
| } else if ($is_hg) { | } else if ($is_hg) { | ||||
| $this->executeMercurialUpdate(); | $this->executeMercurialUpdate(); | ||||
| } | } | ||||
| } | } | ||||
| if ($repository->isHosted()) { | if ($repository->isHosted()) { | ||||
| if ($is_git) { | if ($is_git) { | ||||
| ▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | if ($remote_refs === $local_refs) { | ||||
| pht( | pht( | ||||
| 'Skipping fetch because local and remote refs are already '. | 'Skipping fetch because local and remote refs are already '. | ||||
| 'identical.')); | 'identical.')); | ||||
| return false; | return false; | ||||
| } | } | ||||
| $this->logRefDifferences($remote_refs, $local_refs); | $this->logRefDifferences($remote_refs, $local_refs); | ||||
| // Force the "origin" URI to the configured value. | |||||
| $repository->execxLocalCommand( | |||||
| 'remote set-url origin -- %P', | |||||
| $repository->getRemoteURIEnvelope()); | |||||
| if ($repository->isWorkingCopyBare()) { | |||||
| // For bare working copies, we need this magic incantation. | |||||
| $future = $repository->getRemoteCommandFuture( | $future = $repository->getRemoteCommandFuture( | ||||
| 'fetch origin %s --prune', | 'fetch %P %s --prune', | ||||
| $repository->getRemoteURIEnvelope(), | |||||
| '+refs/*:refs/*'); | '+refs/*:refs/*'); | ||||
| } else { | |||||
| $future = $repository->getRemoteCommandFuture( | |||||
| 'fetch --all --prune'); | |||||
| } | |||||
| $future | $future | ||||
| ->setCWD($path) | ->setCWD($path) | ||||
| ->resolvex(); | ->resolvex(); | ||||
| } | } | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines | |||||