The Literal Commandment
You shall not detest an Edomite, for he is your brother; you shall not detest an Egyptian, because you were an alien in his land. The sons of the third generation who are born to them may enter the assembly of the LORD. (Deuteronomy 23:7-8)
The literal commandment is that we should not detest an Edomite or prevent their third generation children from entering the assembly of the LORD. The implication is that we should prevent the first and second generation children from these unapproved marriages from entering the assembly.