Use --depth 1 when cloning git repos (#217)

This PR actually includes the changes made in #379 as they were needed to make this work.

If you use a version of git < 1.8 the tests fail because shallow clones will still include most tags. It doesn't break anything, but it does mean that you don't get much benefit. I'm not sure if that matters but I thought I should point it out!