Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15395271
D17498.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17498.diff
View Options
diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
@@ -352,44 +352,24 @@
$this->logRefDifferences($remote_refs, $local_refs);
- $retry = false;
- do {
- // This is a local command, but needs credentials.
- if ($repository->isWorkingCopyBare()) {
- // For bare working copies, we need this magic incantation.
- $future = $repository->getRemoteCommandFuture(
- 'fetch origin %s --prune',
- '+refs/*:refs/*');
- } else {
- $future = $repository->getRemoteCommandFuture(
- 'fetch --all --prune');
- }
+ // Force the "origin" URI to the configured value.
+ $repository->execxLocalCommand(
+ 'remote set-url origin -- %P',
+ $repository->getRemoteURIEnvelope());
- $future->setCWD($path);
- list($err, $stdout, $stderr) = $future->resolve();
-
- if ($err && !$retry && $repository->canDestroyWorkingCopy()) {
- $retry = true;
- // Fix remote origin url if it doesn't match our configuration
- $origin_url = $repository->execLocalCommand(
- 'config --get remote.origin.url');
- $remote_uri = $repository->getRemoteURIEnvelope();
- if ($origin_url != $remote_uri->openEnvelope()) {
- $repository->execLocalCommand(
- 'remote set-url origin %P',
- $remote_uri);
- }
- } else if ($err) {
- throw new CommandException(
- pht('Failed to fetch changes!'),
- $future->getCommand(),
- $err,
- $stdout,
- $stderr);
- } else {
- $retry = false;
- }
- } while ($retry);
+ if ($repository->isWorkingCopyBare()) {
+ // For bare working copies, we need this magic incantation.
+ $future = $repository->getRemoteCommandFuture(
+ 'fetch origin %s --prune',
+ '+refs/*:refs/*');
+ } else {
+ $future = $repository->getRemoteCommandFuture(
+ 'fetch --all --prune');
+ }
+
+ $future
+ ->setCWD($path)
+ ->resolvex();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 17, 4:31 AM (2 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707982
Default Alt Text
D17498.diff (2 KB)
Attached To
Mode
D17498: Simplify "git fetch" behavior in the Pull daemon
Attached
Detach File
Event Timeline
Log In to Comment