I hear your concern but don't know where you want to call ensure_current_master. And the method is already calling git checkout master, so SRP has already been violated. How do you want to do this?