Make sure that git operates on the correct repo.

Setting GIT_DIR forces git to operate on the IMP
repository, but we want it to operate on the RMF
submodule first (to get the hash), so postpone setting
GIT_DIR until later.