Yeah, he knew. But you lucked out and got pulled by an honest cop. Rare indeed. You're spray must have covered up the marijuana smell. I doubt he would've let you go if he would've smelled the herb. Most cops would've just lied and said they smelled herb regardless and you'd be fucked.