Commits
Retrieve and compare information about commits.
Prepare:
// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
'client_id' => 'aaa',
'client_secret' => 'bbb'
);
$commits = new \Bitbucket\API\Repositories\Commits();
$commits->getClient()->addListener(
new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);
Get all commits for a repository: (API 2.0)
$commits->all($account_name, $repo_slug);
Get all commits for a single branch: (API 2.0)
$commits->all($account_name, $repo_slug, array(
'branch' => 'master' // this can also be a tag
));
Get an individual commit: (API 2.0)
$commits->get($account_name, $repo_slug, $commitSHA1);
Approve a commit: (API 2.0)
$commits->approve($account_name, $repo_slug, $commitSHA1);
Delete a commit approval: (API 2.0)
$commits->deleteApproval($account_name, $repo_slug, $commitSHA1);