Bitbucket APIList commits not working as expected.
GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubarReturns all commits that are on refs foo or bar, but not on fu or fubar (similar to git log foo bar ^fu ^fubar).
Returns all commits that are on refs foo or bar, but not on fu or fubar (similar to git log foo bar ^fu ^fubar).
foo
bar
fu
fubar
git log foo bar ^fu ^fubar
https://api.bitbucket.org/2.0/repositories/some-org/some-repo/commits?include=mainWorks 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=masterDoes 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)
It looks like you're new here. Sign in or register to get started.