Sahih Bukhari | Volume 1 | Hadith Number 812

Narrated by Ibn 'Umar
During the holy battle of Khaibar the Prophet said, "Whoever ate from this plant (i.e. garlic) should not enter our mosque."