set branch name to detached head if no branch