Skip to content

Commit ee28de6

Browse files
committed
Extend comment of Remote.push by note about push_update_reference.
As happened in support request libgit2/libgit2#3963 it can be easily overseen, that push returns True, when the remote has installed a hook that denies the commits.
1 parent 825f3e4 commit ee28de6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pygit2/remote.py

+6
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ def push(self, specs, callbacks=None):
413413
"""Push the given refspec to the remote. Raises ``GitError`` on
414414
protocol error or unpack failure.
415415
416+
When the remote has a githook installed, that denies the reference
417+
this function will return successfully. Thus it is stronly recommended
418+
to install a callback, that implements
419+
:py:meth:`RemoteCallbacks.push_update_reference` and check the passed
420+
parameters for successfull operations.
421+
416422
:param [str] specs: push refspecs to use
417423
"""
418424
push_opts = ffi.new('git_push_options *')

0 commit comments

Comments
 (0)