gitaly: Cleanup stale reflocks in `prepareReferenceTransaction`
When running prepareReferenceTransaction
, there is a possibility that
it fails due to the existence of stale reference locks in the repository.
Since TransactionManager is the only process apart from housekeeping which writes into the repository, we should be okay with cleaning these stale reference locks.
So in prepareReferenceTransaction
, if we encounter a stale reference
lock, we add an inhibitor on housekeeping from running git-pack-refs(1).
This is to avoid new reference locks from being created. Then we clear
the existing stale reference locks before continuing further.
Closes #4736 (closed)