Revert "Git branch context object fix isCastable bug"

This reverts commit bfaedac5f1c9bcc165a73b94f9d4411acf53bb65.