Split git repo discovery into separate script

This step runs on the bootstrap machine where a git repo is present.
Everything else runs on the generator machine, where we can build
the required binaries.