Browse Source

Fix github url escaping, raw.github.com doesnt like escaped slashes

Jordi Boggiano 12 years ago
parent
commit
432955e0ae

+ 1 - 1
src/Composer/Repository/Vcs/GitHubDriver.php

@@ -128,7 +128,7 @@ class GitHubDriver extends VcsDriver
 
         if (!isset($this->infoCache[$identifier])) {
             try {
-                $resource = 'https://raw.github.com/'.$this->owner.'/'.$this->repository.'/'.urlencode($identifier).'/composer.json';
+                $resource = 'https://raw.github.com/'.$this->owner.'/'.$this->repository.'/'.$identifier.'/composer.json';
                 $composer = $this->getContents($resource);
             } catch (TransportException $e) {
                 if (404 !== $e->getCode()) {

+ 1 - 1
tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php

@@ -197,7 +197,7 @@ class GitHubDriverTest extends \PHPUnit_Framework_TestCase
 
         $remoteFilesystem->expects($this->at(1))
             ->method('getContents')
-            ->with($this->equalTo('github.com'), $this->equalTo('https://raw.github.com/composer/packagist/feature%2F3.2-foo/composer.json'), $this->equalTo(false))
+            ->with($this->equalTo('github.com'), $this->equalTo('https://raw.github.com/composer/packagist/feature/3.2-foo/composer.json'), $this->equalTo(false))
             ->will($this->returnValue('{"support": {"source": "'.$repoUrl.'" }}'));
 
         $remoteFilesystem->expects($this->at(2))