1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Fix VCS drivers to always use identifiers and not tag names since those can change or disappear

This commit is contained in:
Jordi Boggiano 2013-08-18 22:55:54 +02:00
parent 30f94365f0
commit 444bdb2e25
4 changed files with 10 additions and 20 deletions

View file

@ -65,9 +65,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
*/
public function getSource($identifier)
{
$label = array_search($identifier, $this->getTags()) ?: $identifier;
return array('type' => 'git', 'url' => $this->getUrl(), 'reference' => $label);
return array('type' => 'git', 'url' => $this->getUrl(), 'reference' => $identifier);
}
/**
@ -75,10 +73,9 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
*/
public function getDist($identifier)
{
$label = array_search($identifier, $this->getTags()) ?: $identifier;
$url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$label.'.zip';
$url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$identifier.'.zip';
return array('type' => 'zip', 'url' => $url, 'reference' => $label, 'shasum' => '');
return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => '');
}
/**