Skip to content

Don't perform no-op reference updates

Sami Hiltunen requested to merge smh-no-op-reference-update into master

TransactionManager is currently incorrectly recording updates of no-op reference updates that target a packed reference. When we are recording the reference changes, we expect that a reference is written out as a loose reference if it is updated. If the update is a no-op and the reference exists in packed-refs, this leads to an error as there is no new reference file to stage.

Fix this by dropping no-op reference updates. For no-op reference updates, we verify the old value of the reference matches what is expected but drop the update afterwards as it's not necessary to write any changes out.

Closes #5985 (closed)

Merge request reports