Some test helper functions.

There's code that both relies on, and asserts, that the git repo root is the cwd, for simplicity. I don't want to split hairs over whether this is needed only in subprocess calls or not.