fix erro if check out no branch name in git dir