API endpoint for branch existence
Description
There is no way at this moment to check via API only if a branch already exists.
If I want to check for a branch existence, I have to get a full information of a branch using
GET /projects/:id/repository/branches/:branch
Proposal
Add an endpoint to the branches API that will simply check project.repository.branch_exists?(params[:branch])
and return true/false.
No need to gather any additional information from repository about a requested branch.
@DouweM @nick.thomas what do you think?
This issue might be a part of https://gitlab.com/gitlab-org/gitlab-ce/issues/21143 where I want to add a quick check if a branch exists.
Edited by blackst0ne