By the way, this function is not new code - I just moved it out of the `checkout_submodule` routine because for error handling purposes, I wanted to be able to invoke it from two different places.