mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
Change getChangeDate call
Use the v2.0 commit resource instead of the v1.0 changeset resource.
This commit is contained in:
parent
bea4ec7f88
commit
046b1184dc
1 changed files with 8 additions and 4 deletions
|
@ -205,11 +205,15 @@ abstract class BitbucketDriver extends VcsDriver
|
|||
return $this->fallbackDriver->getChangeDate($identifier);
|
||||
}
|
||||
|
||||
$resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/'
|
||||
. $this->owner . '/' . $this->repository . '/changesets/' . $identifier;
|
||||
$changeset = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource);
|
||||
$resource = sprintf(
|
||||
'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date',
|
||||
$this->owner,
|
||||
$this->repository,
|
||||
$identifier
|
||||
);
|
||||
$commit = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource);
|
||||
|
||||
return new \DateTime($changeset['timestamp']);
|
||||
return new \DateTime($commit['date']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue