Skip to content

referencetransaction: Only consider symref HEAD updates

The reference-transaction hook in Git is used to track all reference updates that take place in the repository. We use this information to capture reference updates and feed it to the transaction manager.

Recently, we added changes in 8caf4ebb (referencetransaction: Notify transaction of default branch updates, 2024-04-29) to capture the symref updates, specifically to the HEAD ref. This helps us track default branch updates. But the introduced code also introduced a bug, wherein we were treating all HEAD updates as default branch updates.

This is certainly not the case, since reference-transaction prints HEAD updates to stdout even when the reference that HEAD is pointing to is updated. So we need to ensure that we only capture default branch updates when there is a symref update on HEAD and we need to ignore the others.

Closes #6291 (closed)

Merge request reports