Some issues display "new branch" button even if there's a branch that exists

Description

For some issues that always display the "new branch" button even though the correct currently a branch that exists. If the 'new branch' button is pressed it shows the user a page with a red banner that says "Branch already exists" at the top.

Steps to Reproduce

  1. Create issue

  2. Create branch from issue

  3. Create MR that 1) Does delete the branch and 2) Doesn't close the issue

  4. Create another branch from with same name (using New Branch button)

  5. Go to Step 3

Current bug behavior

When we make the branch not close the issue (for me was removing the Closes #[issue no] from the MR description) the New Branch button becomes available again.

Screenshots / logs

Pasted_Image_4_18_17__11_15_AM

bug

GitLab Version

9.0.5-ee