mikerochip / unity-git-tools

Improve your Unity project's Git integration, mostly for LFS locks
MIT License
3 stars 0 forks source link

Auto-delete lockcache.db when it becomes corrupted #7

Closed mikerochip closed 1 year ago

mikerochip commented 1 year ago

Git LFS creates a file called lockcache.db to cache lock state locally. Unfortunately, this cache file can become corrupted and generate an error when using LFS, preventing updates to the LFS Locks editor. The error looks like:

[Git] LfsCommand="locks"|Error="Unable to create lock system: lock cache initialization: problem reading updated key/value data from ~/my-repo/.git/lfs/lockcache.db: gob: <ErrorMessage>"

where \ can be things like:

duplicate type received
field numbers out of bounds

This file can be safely auto-deleted so Git LFS can re-create it as noted in this Atlassian forum post.