A man who gave a false name when he was detained for shoplifting was given a chance to go straight when he appeared before Lincoln Crown Court.
Matthew Lugsden was serving a suspended prison sentence when he walked into the Tesco Express store in Lincoln's High Street and left without paying for a sandwich and a croissant.
Sarah Lloyd, prosecuting, said staff detained Lugsden and police were called.
Lugsden gave officers a false name but his true identity was revealed during a fingerprint check.
Lugsden, 39, of Barkers Court, Melville Street, Lincoln, admitted theft and obstructing a police officer on September 5.
He also admitted breach of a suspended jail sentence imposed in July for offences of theft and making off without payment.
The court was told that he had convictions for 48 previous offences.
Sam Skinner, defending, said Lugsden has sought help for his drink problem since his arrest and has been turning his life around.
"He has reduced his drinking significantly. That has been no mean feat. He has genuinely turned the corner."
Mr Skinner said Lugsden has recently moved into a new rented home and has started paying off his outstanding fines.
Judge Sean Morris deferred sentence for six months to give Lugsden the opportunity to maintain his progress.
The judge told Lugsden: "If you commit one further offence before the deferment period ends then I will lock you up. It is in your hands."