Well the jury is out on how well marigolds actually 'repel' anything. They are strongly scented and the best read I can get is that they confuse the insects. I know that japanese beetles love the 'Flagstaff' variety (bonus points to anyone who knows why I just had to plant that variety - lol!) and it made it easier to pick them off and drown them in the coffee can of soapy water. But they left the peas alone.
Heh...they were protecting your peas.