Changedget_branch_name to use related branches