Description
Issue
When a branch is deleted via the repository UI, a repo:refs_changed
event is triggered, which is treated as a push event by PAC. As a result, PAC attempts to validate the commit information, leading to an error message. We should prevent this from occurring by ignoring such events directly within the ParsePayload
function to avoid unnecessary log noise.
Solution
The payload of a repo:refs_changed
event includes a changes
array with fromHash
and toHash
fields. When a branch is deleted, the toHash
field will contain a zero hash value (0000000000000000000000000000000000000000
). Therefore, we should check the toHash
value in the event payload, and if it matches the zero SHA, we should return early from the ParsePayload
function without further processing.