I have never heard of any reference to this. Do you have a link?
In any case, it sounds untrue for a few reasons.
Garlic doesn't really smell very bad. A foe is more distracted in combat by the screaming wounded, panicked horses, and trying not to get killed than worrying about what his opponent ate for breakfast.
Even if garlic did smell that horrible (it doesn't), you'd need to be VERY close to smell the garlic. If you wanted to extend the range of the garlic smell, roasting a lot of it before the battle would be more effective than feeding it to men. Even still, a battle would begin at longer range than face to face as skirmishers would be pelting the enemy with stones, javelins, etc at a distance.
Garlic would certainly not be the worst-smelling thing on a battlefield. Think of the massive amount of literal shit that thousands upon thousands of horses and men produce laying out in the hot sun. Think of the sweat of thousands of unwashed bodies. Think of the rotting corpses, as even before a major battle men would still be dying from diseases and minor skirmishes.