Fixing git behaviour for local repos.

Also tests now uses mktemp to create a temporary repo's dir.