Use a more resilient "checkout ref" one-liner