support no remote for primary-branch
primary-branch: fall back to current-branch if no others are found