Gitlab::Git::Repository#find_branch has a similar logic. Fixes #42609
Attach a file by drag & drop or click to upload