Wiki checkout failure on clone

Problem to solve

Having a bit of odd behavior with wikis; I suspect a user on my installation may have borked the repository somehow, but I’m not sure how/if it can be fixed in a nice way.

When I clone a wiki repository, I get this warning:

remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

I can see some branches:

image

When I cat .git/HEAD I get:

ref: refs/heads/master

Similarly, from a working wiki repo that does not have this issue; interestingly, the default branch of this wiki’s associated repo is NOT main, it is master

ref: refs/heads/main

After cloning, I end up with an empty repository and no branch checked out. However, I am able to simply git checkout master and everything checks out fine, all of the files are present.

If I clone a fresh wiki from another project, I do not get the same behavior, so it would seem to me that someone pushed something in a way they shouldn’t have that caused this, unfortunately I have no way of knowing what this might be.

Is there any way for me to resolve this via the GitLab UI or from a local clone of the repository on my machine?

Versions

Please select whether options apply, and add the version information.

Versions

  • GitLab 16.11