Try if branch_exists? would work, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_18424135
Showing
Please register or sign in to comment
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_18424135