It is possible this is a side-effect of how git pre-push hook has been implemented:
See commit ec55559.
The list of commit that will be pushed is computed before your extra commit is generated.
So, it doesn't push your extra-commit, and your "git checkout staging/git merge
" doesn't prove anything, because it is a local operation.
That means your local branch is indeed ahead by one commit of the upstream branch.
Note that you can do an alias which would call:
git push
git push --no-verify
The second push would not call the pre-push hook, and push your extra commit created by the first one.