Dude next time a cop pulls you over just act chill. If you had no priors and acted chill, the cop really wouldn't have cared if you told him he couldn't search your car.
Reminds me onetime I was riding with one of my buds and we had a few joints (maybe 2 grams) in the back seat. A cop pulls up behind us while were on the road and I notice hes pretty close to my friends car. I tell my friend that hes getting his plates ran and freaks out and tries to ditch the cops. He pulls into a church and cop lights up and comes to the car. My friend was freaking out and shit. The cop pulled him over because he had bad tags. The cop asks to search the car and he says ya for some reason. I grab the joints and put them in my pocket when the cop isn't looking. Everyone gets searched, except for me. I told him I didn't consent and all he says is "ok".
I have been in situations where I have been searched even when I do not consent. You can't do shit then. Usually though they will know they broke the law to get your shit and will just let you off with some kind of "deal". If they still jail ya (hasn't happened to me yet) then hire a lawyer
Are Texas cops pricks about marijuana?