Display an error when repository has an ambiguous head branch
What does this MR do and why?
Contributes to #381731 (closed)
Problem
User cannot change the default branch when the repository has an
ambiguous head
branch. We show a successful message to the user.
More details
Before git
version 2.16.0 users could create a branch named HEAD
that collides with internal HEAD
reference. It causes an ambiguity that blocks users from updating the default branch of the repository.
This bug was fixed in git via this commit. But some old repositories can still contain a stale HEAD branch.
How to fix
- Go to the repository -> branches (https://gitlab.com/gitlab-org/gitlab/-/branches)
- Search for branch named
HEAD
(https://gitlab.com/gitlab-org/gitlab/-/branches?state=all&search=%5EHEAD) - Verify that the branch does not contain any uncommitted changes and delete it
Solution
Display an error with a hint what can be wrong.
Screenshots or screen recordings
How to set up and validate locally
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin