tests: use test_create_repo instead of "git init"

This gets us a more consistent initial repository state with a fixed
template and no hooks.

Also change the setup code to use a subshell instead of the "cd there;
...; cd back" anti-pattern.

Signed-off-by: John Keeping <john@keeping.me.uk>