Skip to content

Wrong name in branch created from an issue

Summary

When creating a branch & merge request from an issue, if the field Source (branch or tag) is changed after the branch name has been modified, then the created branch does not keep the correct name, but the default one. It is not that the name field in the interface is reset (the user still sees the customised one), but that the content of that field in the background is reset.

Steps to reproduce

  1. Open an issue on Gitlab.
  2. Navigate to that issue's page
  3. Click on the small arrow next to the 'Create merge request' button.
  4. Either keep the selector on 'Create merge request and branch' or 'Create branch'. Both produce the same issue.
  5. Customise your branch name.
  6. Change the 'Source (branch or tag)' field (you need to have more than one branch or at least one tag for this).
  7. Click on the 'Create merge request' button.
  8. Go check the newly created branch. Its name will be the default one suggested by GitLab and not the customised one.

Example Project

https://gitlab.com/lidia.parrilla1/branch-name-from-issue-example-project

What is the current bug behavior?

The created branch has the default name suggested by GitLab but the branch name field does show the customised name at the moment of creating it.

What is the expected correct behavior?

The branch should keep the name that the user customised.

Relevant logs and/or screenshots

Creation form with customised branch name:

chrome_WFMmi1JucW

Next, source branch is modified. The branch name field keeps the customised value:

chrome_x0s1ysVDMO

The created branch has the original value suggested by GitLab, instead of the customised one:

chrome_652e5xdotG

Output of checks

This bug happens on GitLab.com

Possible fixes

Sorry, I'm not familiar with the repo.

Edited by Lidia Parrilla Benítez