Deuteronomy 23:7-17

7 But have no hate for an Edomite, because he is your brother, or for an Egyptian, for you were living in his land.
8 Their children in the third generation may come into the meeting of the Lord's people.
9 When you go out to war and put your tents in position, keep from every evil thing.
10 If any man among you becomes unclean through anything which has taken place in the night, he is to go out from the tent-circle and keep outside it:
11 But when evening comes near, let him take a bath: and after sundown he may come back to the tents.
12 Let there be a place outside the tent-circle to which you may go;
13 And have among your arms a spade; and when you have been to that place, let that which comes from you be covered up with earth:
14 For the Lord your God is walking among your tents, to keep you safe and to give up into your hands those who are fighting against you; then let your tents be holy, so that he may see no unclean thing among you, and be turned away from you
15 Do not give back to his master a servant who has gone in flight from his master and come to you:
16 Let him go on living among you in whatever place is most pleasing to him: do not be hard on him.
17 No daughter of Israel is to let herself be used as a loose woman for a strange god, and no son of Israel is to give himself to a man.