Document PushInfoList · gitpython-developers/GitPython@5bce9b4

@@ -278,6 +278,10 @@ def iter_items(cls, repo: "Repo", *args: Any, **kwargs: Any) -> NoReturn: # ->

278278279279280280

class PushInfoList(IterableList[PushInfo]):

281+

"""

282+

IterableList of PushInfo objects.

283+

"""

284+281285

def __new__(cls) -> "PushInfoList":

282286

return cast(PushInfoList, IterableList.__new__(cls, "push_infos"))

283287

@@ -1004,7 +1008,7 @@ def push(

10041008

progress: Union[RemoteProgress, "UpdateProgress", Callable[..., RemoteProgress], None] = None,

10051009

kill_after_timeout: Union[None, float] = None,

10061010

**kwargs: Any,

1007-

) -> IterableList[PushInfo]:

1011+

) -> PushInfoList:

10081012

"""Push changes from source branch in refspec to target branch in refspec.

1009101310101014

:param refspec: see 'fetch' method

@@ -1025,13 +1029,13 @@ def push(

10251029

should be killed. It is set to None by default.

10261030

:param kwargs: Additional arguments to be passed to git-push

10271031

:return:

1028-

list(PushInfo, ...) list of PushInfo instances, each

1029-

one informing about an individual head which had been updated on the remote

1030-

side.

1032+

A ``PushInfoList`` object, where each list member

1033+

represents an individual head which had been updated on the remote side.

10311034

If the push contains rejected heads, these will have the PushInfo.ERROR bit set

10321035

in their flags.

1033-

If the operation fails completely, the length of the returned IterableList will

1034-

be 0."""

1036+

If the operation fails completely, the length of the returned PushInfoList will

1037+

be 0.

1038+

Call ``.raise_if_error()`` on the returned object to raise on any failure."""

10351039

kwargs = add_progress(kwargs, self.repo.git, progress)

10361040

proc = self.repo.git.push(

10371041

"--",