learned to cope with HEAD referencing a non-existing branch

This is the case after 'git init'. HEAD points to refs/heads/master, but refs/heads/master does not exist.