Update origin/HEAD when default branch has changed
When the default branch of a repository has changed / was deleted (e.g. when switching from master to main), origin/HEAD is not valid / missing anymore.
In this case, we have to do something like this:
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
where origin/main
is the new default branch of the repository.