When Pyle finally says he really going to return the horse, he leaves Sergeant Carter and the abandoned supply shed set for destruction in his greens. In the next shot, as he's leading the horse down the path, he is in his khakis.
The horse named "Dolly" is not a mare. It is clearly a gelding.