From 13a2bc6ff0884c8acc7a33e7346dbe773e26d31d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 4 Apr 2012 17:11:10 +0200 Subject: [PATCH] Revert "Fix push url hack" This reverts commit 269537e4661e3006a2a28afdce095a66fc3b13cc. --- src/Composer/Downloader/GitDownloader.php | 4 ++-- tests/Composer/Test/Downloader/GitDownloaderTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index c6ac29ea0..5c782a330 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -119,8 +119,8 @@ class GitDownloader extends VcsDownloader // set push url for github projects if (preg_match('{^(?:https?|git)://github.com/([^/]+)/([^/]+?)(?:\.git)?$}', $package->getSourceUrl(), $match)) { $pushUrl = 'git@github.com:'.$match[1].'/'.$match[2].'.git'; - $cmd = sprintf('cd %s && git remote set-url --push origin %s', escapeshellarg($path), escapeshellarg($pushUrl)); - $this->process->execute($cmd, $ignoredOutput); + $cmd = sprintf('git remote set-url --push origin %s', escapeshellarg($pushUrl)); + $this->process->execute($cmd, $ignoredOutput, $path); } } } diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index f03b09f83..2c8767b84 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -89,7 +89,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo($expectedGitCommand)) ->will($this->returnValue(0)); - $expectedGitCommand = $this->getCmd("cd 'composerPath' && git remote set-url --push origin 'git@github.com:composer/composer.git'"); + $expectedGitCommand = $this->getCmd("git remote set-url --push origin 'git@github.com:composer/composer.git'"); $processExecutor->expects($this->at(3)) ->method('execute') ->with($this->equalTo($expectedGitCommand))