The important thing to understand is that breastmilk is made in the alveoli using proteins, sugars and fat from the mother's blood supply, not from the mother's digestive tract.
The make up of these 'ingredients' does depend on the mother's diet - for example, if the baby has an allergy to certain dietary proteins then the mother may need to follow an elimination diet to avoid passing these proteins on. A sensitivity or allergy may result in gassiness, fussiness, constipation/diarrhea, reflux, eczema, blood in the stool or hives among other symptoms. However, it is not as simple as thinking that food that makes mum gassy would also make baby gassy - since the digestive gas is not part of the milk-making process!
In the majority of cases, mothers do not need to change their diet for breastfeeding.
If the mother is exposed to a virus such as a cold, or other mild infectious illness then the milk will contain antibodies but not the virus itself. This is the case whether or not the mother has symptoms.
For example, the CDC advice (CDC page on flu + breastfeeding) states that
Flu is not spread to infants through breast milk.
Breast milk is the best source of nutrition for infants and provides
protection from infections through antibodies and other immunological
factors. Infants who are breastfed are less vulnerable to infections,
including severe respiratory illnesses, than infants who are not
breastfed. When a mother has flu, her breast milk contains antibodies
that can help protect her infant from flu and breast milk remains the
recommended source of nutrition for the infant, even while the mother is
Other links that may be helpful - note that this website is for profit (sponsored) and not an authoritative source, but very informative.
Kellymom - mom's diet
Kellymom - food allergies