I have a pre-receive plugin which runs for all pushes (refs, commits, etc.). I also have a script which is run periodically to tag the master branch of a cloned repo then push that tag to BitBucket. When the tag is pushed (via 'git push origin $tag --force') the pre-receive hook is running for a merge commit which was pushed nearly 3 months ago.
When this commit is processed it is causing the hook to reject the push and thus the tag isn't being set within BitBucket. (I believe the rejection is likely a problem with my hook; I'm not asking about that.)
Why is this commit being processed when all that happened was a tag being pushed? How can I prevent this from happening when a tag is pushed?
BitBucket version 5.15.1