Bitbucket API
List commits not working as expected.
GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar
Returns all commits that are on refs
foo
orbar
, but not onfu
orfubar
(similar togit log foo bar ^fu ^fubar
).
https://api.bitbucket.org/2.0/repositories/some-org/some-repo/commits?include=main
Works as expected. It returns:
{
"values": [
{
"type": "commit",
"hash": "some-hash",
...
}
ttps://api.bitbucket.org/2.0/repositories/some-org/some-repo/commits?include=main&include=master
Does not work. Should return all commits that match the branches, ignore if branch does not exists. Currently it returns:
{
"type": "error",
"error": {
"message": "Commit not found",
"data": {
"shas": [
"master"
]
}
},
"data": {
"shas": [
"master"
]
}
}
G'day @Sebastian Rincon !
Welcome to the Bitbucket Cloud community! :)
I have been able to reproduce the same behaviour as you have described - indeed, if one of the two branches does not exist, an error is returned rather than results being returned for the existing branch.
I've raised a feature request on your behalf with our developers to improve our API's filtering abilities - please feel free to Watch this to receive future updates related to it and Vote for it to improve its visibility with regard to customer demand:
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.