diff options
Diffstat (limited to 'git')
-rw-r--r-- | git/remote.py | 16 | ||||
-rw-r--r-- | git/repo/base.py | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/git/remote.py b/git/remote.py index 47a0115b..4240223e 100644 --- a/git/remote.py +++ b/git/remote.py @@ -278,6 +278,10 @@ class PushInfo(IterableObj, object): class PushInfoList(IterableList[PushInfo]): + """ + IterableList of PushInfo objects. + """ + def __new__(cls) -> "PushInfoList": return cast(PushInfoList, IterableList.__new__(cls, "push_infos")) @@ -1051,7 +1055,7 @@ class Remote(LazyMixin, IterableObj): allow_unsafe_protocols: bool = False, allow_unsafe_options: bool = False, **kwargs: Any, - ) -> IterableList[PushInfo]: + ) -> PushInfoList: """Push changes from source branch in refspec to target branch in refspec. :param refspec: see 'fetch' method @@ -1072,13 +1076,13 @@ class Remote(LazyMixin, IterableObj): should be killed. It is set to None by default. :param kwargs: Additional arguments to be passed to git-push :return: - list(PushInfo, ...) list of PushInfo instances, each - one informing about an individual head which had been updated on the remote - side. + A ``PushInfoList`` object, where each list member + represents an individual head which had been updated on the remote side. If the push contains rejected heads, these will have the PushInfo.ERROR bit set in their flags. - If the operation fails completely, the length of the returned IterableList will - be 0.""" + If the operation fails completely, the length of the returned PushInfoList will + be 0. + Call ``.raise_if_error()`` on the returned object to raise on any failure.""" kwargs = add_progress(kwargs, self.repo.git, progress) refspec = Git._unpack_args(refspec or []) diff --git a/git/repo/base.py b/git/repo/base.py index 7473c52e..d4463f1e 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -498,7 +498,7 @@ class Repo(object): def create_tag( self, path: PathLike, - ref: str = "HEAD", + ref: Union[str, 'SymbolicReference'] = "HEAD", message: Optional[str] = None, force: bool = False, **kwargs: Any, |