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