As happened in support request https://github.com/libgit2/libgit2/issues/3963 it can be easily overseen, that push returns True, when the remote has installed a hook that denies the commits.