Skip to content

Commit

Permalink
Make sure github driver is used for all github urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 12, 2012
1 parent 160d2e0 commit c293302
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/Composer/Downloader/GitDownloader.php
Expand Up @@ -129,9 +129,16 @@ protected function runCommand($commandCallable, $url, $path = null)
if (0 === $this->process->execute($command, $handler)) {
return;
}
if (null !== $path) {
$this->filesystem->removeDirectory($path);
}
$retrying = true;
} while (--$retries);
}

if (null !== $path) {
$this->filesystem->removeDirectory($path);
}
$this->throwException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(), $url);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Composer/Repository/Vcs/GitHubDriver.php
Expand Up @@ -43,7 +43,7 @@ class GitHubDriver extends VcsDriver
*/
public function initialize()
{
preg_match('#^(?:https?|git)://github\.com/([^/]+)/(.+?)(?:\.git)?$#', $this->url, $match);
preg_match('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $this->url, $match);
$this->owner = $match[1];
$this->repository = $match[2];
$this->originUrl = 'github.com';
Expand Down Expand Up @@ -177,7 +177,7 @@ public function getBranches()
*/
public static function supports(IOInterface $io, $url, $deep = false)
{
if (!preg_match('#^(?:https?|git)://github\.com/([^/]+)/(.+?)(?:\.git)?$#', $url)) {
if (!preg_match('#^((?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url)) {
return false;
}

Expand Down

0 comments on commit c293302

Please sign in to comment.