Skip to content

Clear packed-refs locks when encountering them

Sami Hiltunen requested to merge smh-packed-refs-locks into master

The TransactionManager is currently clearing packed-refs locks on initialization. This is somewhat wasteful given there generally wouldn't be any stale lock files. If a partition has multiple repositories, this is increasingly wasteful as we'd have to check every repository when initializing. Move the lock file clearing to happen instead when we encounter locks while attempting to work on the repository. This lazier method of clearing the locks works better with many repositories.

The tests related to packed-refs lock clearing were split in two to ensure both possible lock files are correctly detected.

Merge request reports