Bitbucket pre-receive hook: get remote branch information

In a pre-receive hook, I need to read a file on the remote repository in a branch. In the hook script, I am able to get the “commit from” branch using the following code:

public boolean onCommitAdded(@Nonnull CommitAddedDetails commitDetails) {
String fromBranchName = commitDetails.getRef().getDisplayId();

How do I get the “to/target branch name” where I commit the file(s) to?

Thanks for your help in advance!