Hook is slow when pushing a new branch
Issue #4
resolved
When pushing a new branch, the hook is extremely slow.
Comments (5)
-
reporter -
reporter - changed status to resolved
-
We were having this same issue and we found this pull request. My admin compiled your 1.0.3 tag and it seemed to do the trick. Thank you.
-
reporter Issue
#5was marked as a duplicate of this issue. -
reporter I have released version 1.0.3 to the marketplace:
https://marketplace.atlassian.com/plugins/com.carolynvs.reject-merge-commit-hook
- Log in to comment
Stash is passing 0 as the from SHA when pushing to a new branch, causing the hook to evaluate all change sets, not just the new ones included in the push.
See https://answers.atlassian.com/questions/223143/how-to-get-only-new-changesets-in-pre-receive-hook-on-new-branch-push
Since identifying the commits included in the push is not very straightforward, and only new branches are affected, it makes more sense to just not check for merge commits on new branches.