peru
peru copied to clipboard
Changing the cache can cause "failed to unpack tree object" errors
Say you run peru sync
and then you change the value of PERU_CACHE
and run peru sync
again. The lastimports
file will contain a reference to a tree that's not in your new cache, and you'll get a git error. We should detect this case ("hey, it looks like your last imports tree is no longer in cache") and allow the --force
flag to just pave over everything.
Maybe the right way to fix this is to check that a tree hash is present in the cache repo after retrieving it from the keyval. If not, just return None instead of returning the invalid tree.
I feel like I'm seeing this issue occasionally, even though I've had PERU_CACHE_DIR=/home/jacko/.peru-cache
for many months. Is there some git cleanup process that might be removing unreferenced trees?