Enhance docker test script to checkout arbitrary git refs.