Fix wiki repositories with wrong HEAD
What does this MR do?
Recently, we allowed wikis to use the instance default branch #221159 (closed). Nevertheless, there is a problem.
Before, when we created a project, the wiki repository was created as well, and HEAD
was set to master
.
Then, after the issue was implemented, if the repository root_ref
was empty, we used the instance default branch to perform the pushes to, and here is where we have the problem, because HEAD
was still pointing to master
instead of the instance default branch.
In this MR, we're fixing that by changing the HEAD
whenever we detect that there are no commits in the HEAD
branch.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Related to #221159 (closed)