Why do we need the condition

itemCount > 0 && sortedRefs.size() > 0

here?

I have created a new repo, made one commit and created a new branch "b", but did not check it out. When I now open "Team -> Switch To" I do not see branch "b".