Why does /2.0/repositories/{}/{}/refs/branches fail to return all branches

markhamlin February 27, 2020

I have a private repo on Bitbucket Cloud with 7 branches.  A call to the API returns all but one.  I have tried fiddling with pagsize  and pagelength with no success.  Are there any known problems or restrictions with this endpoint? 

https://api.bitbucket.org/2.0/repositories/{myteam}/{repo}/refs/branches

 

Or is there an alternative endpoint I should be using?

 

1 answer

1 vote
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2020

Hello @markhamlin ,

Welcome to the Community.

The endpoint you refer to is the right one to list all branches of your repository. 

Do you see all 7 branches in Bitbucket's UI, e.g. here:

https://bitbucket.org/<workspace>/<repository_slug>/branches/?status=all

If not, how did you count those 7 branches – maybe one of them is not pushed to Bitbucket and only exists on your local working copy?

If you believe there's an issue, please open a support case with us and point to the repository in question so that we can take a look.

Hope this helps.

Cheers,
Daniil

markhamlin February 28, 2020

I was counting remotes under the origin section in Sourcetree.  A look directly on the portal and a fresh clone both revealed the missing branch had been closed, so no missing branches after all, API working properly.  Thanks for your help. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events