Simplify reference updates in transactions
Gitaly may perform multiple Git reference transactions during an RPC to update the references. TransactionManager
is currently capturing each of these reference updates and replaying them to verify. Since we don't care about the intermediate state of reference within a transactions, only the final end state, we could simplify and stop considering the intermediate states.
We can't collapse all reference updates into a single reference transaction as there could be file-directory conflicts. Looking at the end state of the references, we could first delete all references that no longer exist in one reference transaction, and create/update all the changed references in a second reference transaction. That would simplify the process overall and lead to better performance as well by skipping the unnecessary intermediate states from verification and logging.