use a more stable way to find the current branch name