Fixes #506. Work correctly with local git repositories.

Clone local git repos into the cache so that they can be treated identically to remote ones.

I don't believe the rewrite suffers from this problem, but that is just from reading the code, I haven't tested it.

To properly test this I have included a git repo inside the git repo.