Skip to content

Commit 5bce9b4

Browse files
skinitimskiByron
authored andcommitted
Document PushInfoList
1 parent 787359d commit 5bce9b4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: git/remote.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ def iter_items(cls, repo: "Repo", *args: Any, **kwargs: Any) -> NoReturn: # ->
278278

279279

280280
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.
10091013
10101014
: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
"--",

0 commit comments

Comments
 (0)