1
0
Fork 0
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:
Stefan Grootscholten 2017-01-22 14:58:35 +01:00
parent bea4ec7f88
commit 046b1184dc

View file

@ -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']);
}
/**