restore GitAPI "checkoutBranch" logic for backward compatibility