#3237 Make sure is_forced_push doesn't raise when pushing new branch with no-force-push hook active
Merged by pingou. Opened by bkabrda.
bkabrda/pagure force-push-hook-new-branch  into  master

Download 3237.patch

If the PagureForceCommitHook is active on a project and one tries to push new branch, the following error is printed by git push and the push is refused:

remote: ERROR: ['git', 'rev-list', '0000000000000000000000000000000000000000', '^0e6e0b6c931d65ee22f67205a53933d841c6eeff'] =-- 128
remote: 
remote: fatal: bad object 0000000000000000000000000000000000000000

This patch makes sure this doesn't happen by checking if theoldrev in is_forced_push is all zeroes.

Ok, thanks :)

Pull-Request has been merged by pingou

Metadata