Who keeps the pet in a contested divorce?

If you are a devoted pet owner, you will probably go to great lengths to keep your dog or cat with you in the event of a divorce. But what happens when you and your soon-to-be ex-spouse can’t reach an agreement about who will keep the pet when the humans split?...