Most of the world's mothers breastfeed, because they are poor. Their diets are fairly simple, and they have developed some pretty spicy cuisines to liven up their diets. And yet their babies are generally very happy. They are usually so hungry and happy to nurse they just don't seem to mind. As for gas-producing foods, forget it.
Gas is swallowed air, period.
Beans give people gas, for example, because microorganisms in the human gut ferment certain sugars in the beans to produce gases. These gases DO NOT get in the mother's bloodstream to be secreted in the milk. Gee, honey, your milk is awfully foamy tonight. It is thought that sometimes fragments of cow milk protein enter the mother's bloodstream, and are secreted in the mother's milk, causing symptoms of milk allergy in the baby. I've tried milk-free diets for colicy crying before, but it hasn't helped very often.