Skip to content

Adding inital types to remote.py #1229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add types to PushInfo.__init__() .remote_ref() and .old_commit()
  • Loading branch information
Yobmod committed May 3, 2021
commit c08f592cc0238054ec57b6024521a04cf70e692f
8 changes: 4 additions & 4 deletions git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -126,11 +126,11 @@ def __init__(self, flags, local_ref, remote_ref_string, remote, old_commit=None,
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
Expand Down