-
Notifications
You must be signed in to change notification settings - Fork 518
Open
Labels
Description
Problem
When gitlist tries to load a repository where the HEAD is set to a non-existent branch, which can happen in backup situations, it will fail and return a 500 error with the log message git: fatal: Not a valid object name HEAD.
I found this is particularly a problem when self-hosting bare git repositories, since the location of HEAD is non-obvious in this case.
Workaround
Enter the broken repository and set HEAD to a branch that actually exists:
git symbolic-ref HEAD refs/heads/mainProposed Solution
Instead of failing to load, gitlist should search for plausible main branches such as master, main, or trunk. If it does not find these, it should select the first branch that it finds as the default branch to render.