Fix bug in finding default branch
In some repositories (probably repositories where the default branch was renamed) the following error may occur:
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
This fixes the way of obtaining the default branch.
Please report an issue if you get an error and include the list of branches:
git branch -a | cat