From c21a8d31dde2c9d684dc0c48784e0c90931401d8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 23 Jan 2014 17:23:38 -0800 Subject: [PATCH] When repairing Git remote URIs, include credentials Summary: See IRC. Currently, if a fetch fails, we may repair the remote URI incorrectly, replacing it with one without any credentials. Instead, retain credentials. Test Plan: Faked it locally, got le-boom to verify on IRC. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D8055 --- .../repository/engine/PhabricatorRepositoryPullEngine.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php index c0ee14ae76..e935740743 100755 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -303,10 +303,10 @@ final class PhabricatorRepositoryPullEngine // Fix remote origin url if it doesn't match our configuration $origin_url = $repository->execLocalCommand( 'config --get remote.origin.url'); - $remote_uri = $repository->getDetail('remote-uri'); - if ($origin_url != $remote_uri) { + $remote_uri = $repository->getRemoteURIEnvelope(); + if ($origin_url != $remote_uri->openEnvelope()) { $repository->execLocalCommand( - 'remote set-url origin %s', + 'remote set-url origin %P', $remote_uri); } } else if ($err) {