Fixed git branch detection when no default branch is set and the master branch is empty.