If you are advised to stop eating foods that cause "gasses" (broccoli, cauliflower, and others from the same family are common offenders), know that foods that make you windy do not necessarily make your baby windy as well, because breast milk is made by your body from the stuff that is in your blood stream, not in your stomach or bowels! Spicy foods are another controversial topic for many. If you think you need to stop enjoying chilly peppers, garlic, and other goodies that you love, don't worry too much about it.
Breast milk does take on some of the flavor of the foods that you eat. If you are a lover of spicy foods, it is better to get your baby to enjoy them right at the beginning, so they will eat what you cook later on in life, right? Think about countries where spicy foods are always part of the diet, like India or Korea for instance. There is no evidence to suggest Asian babies are more gassy or have upset tummies.
Now for the more individual answer. If your baby seems fussy, gassy, and you think it is caused by certain foods, you may well be right. Common offenders are peanuts, dairy, and others. Some moms do well with an elimination diet to figure out what their babies might be allergic too. If you have a family history of allergies, you can start considering not eating the "offending" foods while you are still pregnant.