FORGE-1887: Throwing exception when branch cannot be switched