Make the test cache repository a bit more resilient against partial clones

Fixes #589