Skip to content

Fix broken branch switch with similar names

Samantha Ming requested to merge 322792-switch-branch-of-shorter-name into master

What does this MR do?

Fix the broken URL when switching branches with a similar name from its longer name to its shorter name.

Example:

  • development -> dev
  • production -> prod

The solution is to ensure an exact match instead of a partial match.

Problem Fixed
development-to-dev-branch switching-branch-long-short-name

Testing Case

  1. Navigate to a project Repository
  2. Repository should have 2 branches with similar names. You can also create these branches.

Example Branches:

  • dev
  • development

Switch the branch from its longer name to its shorter name and it will work (does not display error flash message).

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #322792 (closed)

Edited by Samantha Ming

Merge request reports

Loading