Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket - getting branch name of browsed resource

Megi Es August 24, 2016

Hi,

I'm reading files in repository that were changed in some particular commit, using Change interface. I can't find any information about branch on which browsed file is located.

Is there any way to obtain this information?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Megi Es September 22, 2016

My answer:

You can get branch name while iterating through ref changes passed as parameter for onReceive()/postReceive() method of repository hook. Simply use:

refChange.getRef();

All changes read for one ref change concerns this branch.

 

TAGS
AUG Leaders

Atlassian Community Events