A man jailed after ignoring a ban on contacting his ex was told that he will be released in time for Christmas - provided he behaves himself.
Darren Mooney appeared at Kirklees Magistrates’ Court over a video link from Armley Prison.
He pleaded guilty to breaching an indefinite restraining order made in 2013 after he assaulted his ex.
The order included a ban on contacting her or going to her home but the 38-year-old repeatedly ignored this.
Between October 13 and 19 he sent her various text messages.
Prosecutor Alex Bozman said that one of these was concerning as it suggested he knew where she was.
Mooney, of Chesil Bank in Quarmby , also admitted to thefts from three shops between October 19 and November 14.
Magistrates warned Mooney that the restraining order against him lasts until a court states otherwise and he must not contact his former partner again.
He is currently a serving prisoner after being sentenced to custody for breaching his probation order.
They sentenced him to six weeks in custody but the sentence won’t affect his expected release date of December 24.
Bench chairman Jason Beaumont told him: “That’s a bit of an early Christmas present for you as you will be out in time.
“I must reiterate that the restraining order is still in place and you must not contact her - whether it’s by carrier pigeon or WhatsApp.
“Do not breach it again or you will be in prison for Christmas and New Year as well.”