It is narrated from Hazrat Abu Hurairah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: Whoever eats from this plant (garlic) should not harm us in our mosque.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 7583