diff options
author | yobmod <yobmod@gmail.com> | 2021-05-03 16:16:14 +0100 |
---|---|---|
committer | yobmod <yobmod@gmail.com> | 2021-05-03 16:16:14 +0100 |
commit | c08f592cc0238054ec57b6024521a04cf70e692f (patch) | |
tree | b0587b43719ab062dcd6fe9d9cd19d3482486eec /git/remote.py | |
parent | a1fa8506d177fa49552ffa84527c35d32f193abe (diff) | |
download | gitpython-c08f592cc0238054ec57b6024521a04cf70e692f.tar.gz |
add types to PushInfo.__init__() .remote_ref() and .old_commit()
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/remote.py b/git/remote.py index 7d6c0f6f..8404b190 100644 --- a/git/remote.py +++ b/git/remote.py @@ -115,8 +115,8 @@ class PushInfo(object): '=': UP_TO_DATE, '!': ERROR} - def __init__(self, flags, local_ref, remote_ref_string, remote, old_commit=None, - summary=''): + def __init__(self, flags: Set[int], local_ref: SymbolicReference, remote_ref_string: str, remote, + old_commit: Optional[bytes] = None, summary: str = '') -> None: """ Initialize a new instance """ self.flags = flags self.local_ref = local_ref @@ -126,11 +126,11 @@ class PushInfo(object): self.summary = summary @property - def old_commit(self): + def old_commit(self) -> Optional[bool]: return self._old_commit_sha and self._remote.repo.commit(self._old_commit_sha) or None @property - def remote_ref(self): + def remote_ref(self) -> Union[RemoteReference, TagReference]: """ :return: Remote Reference or TagReference in the local repository corresponding |