1
0
Fork 0

Change getChangeDate call

Use the v2.0 commit resource instead of the v1.0 changeset resource.
pull/6094/head
Stefan Grootscholten 2017-01-22 14:58:35 +01:00
parent bea4ec7f88
commit 046b1184dc
1 changed files with 8 additions and 4 deletions

View File

@ -205,11 +205,15 @@ abstract class BitbucketDriver extends VcsDriver
return $this->fallbackDriver->getChangeDate($identifier); return $this->fallbackDriver->getChangeDate($identifier);
} }
$resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/' $resource = sprintf(
. $this->owner . '/' . $this->repository . '/changesets/' . $identifier; 'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date',
$changeset = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource); $this->owner,
$this->repository,
$identifier
);
$commit = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource);
return new \DateTime($changeset['timestamp']); return new \DateTime($commit['date']);
} }
/** /**