Do not update cache in non-git dir

Fixes #1