Avoid corrupting caches when network is unavailable
Avoid corrupting caches when network is unavailable

This removes the use of a tempfile entirely, and only updates the cache
when `git ls-remote` succeeds.

Based on a PR by polygamma:

https://github.com/falconindy/asp/pull/20

falconindy/asp