switch git submodule versions correctly

when switching to a revision also switch to the corresponding submodule version

I don't know how this shell stuff works, I just tried to do it the same way it originally fetched it.