Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket Plugin Development - List of branches in a repo

Eric Zimmerman December 6, 2018

I am new to the SDK.

I am looking to make a simple PreRepositoryHook which compares the branch name being pushed to the server with a list of the branches to check for a capitalization/case bug that was causing a good deal of frustration.

From an example, this feels like part of the solution:

 request.getScmHookDetails().ifPresent(scmDetails -> { 
request.getRefChanges().forEach(refChange -> {
if ("refs/heads/master".equals(refChange.getRef().getId()) &&
refChange.getType() == RefChangeType.UPDATE) {
scmDetails.out().println("You should create a pull request and " + "get some input from your team mates!"
);
}

});

});

 

Could someone point me in the right direction on how to retrieve a list of the branches in the repository on bitbucket?

Best regards,

Eric

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events