Although breastfeeding is thought to create more adventurous tastes in babies, it isn't uncommon for a baby to dislike the taste of their mother's milk one day and then like it again the next. Believe it or not, the food you eat directly influences the taste of your milk, and if your baby tastes something they don't like, they may go on a nursing strike or have a hard time eating. Luckily, there are foods you can eat to make your breast milk taste better (and no, more sugar isn't the answer,) but more often than not, knowing what to avoid will solve the issue.
One study in Denmark determined that the foods mothers eat can flavor their milk for up to eight hours after eating it. For example, eating a particularly spicy meal can make your breast milk have the same spice that your meal did (although in a notably less concentrated form.) Additionally, things like garlic, broccoli, onions, or other rich or strong-smelling foods can cause your milk to be more strongly flavored — sometimes setting your baby off.
Pregnancy magazine stated that the most common culprits that cause a baby to not like the taste of breast milk are coffee (or other caffeinated beverages,) dairy, and spicy foods. These could also cause other issues like making your baby overly-jittery (in the case of too much caffeine,) or have other stomach problems, although that is considered rare.
However, Fox News also noted that just because your milk may be tinted with a certain spice, doesn't mean you need to avoid it altogether. In fact, introducing your baby to a wide variety of flavors through your breast milk can help them become more adventurous and less picky as they grow up.
So unless your baby is clearly put off by a certain food you ate earlier in the day, continue to eat a wide variety and let your baby "taste the rainbow," so to speak.