Skip to content

Commit c08f592

Browse files
committed
add types to PushInfo.__init__() .remote_ref() and .old_commit()
1 parent a1fa850 commit c08f592

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git/remote.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class PushInfo(object):
115115
'=': UP_TO_DATE,
116116
'!': ERROR}
117117

118-
def __init__(self, flags, local_ref, remote_ref_string, remote, old_commit=None,
119-
summary=''):
118+
def __init__(self, flags: Set[int], local_ref: SymbolicReference, remote_ref_string: str, remote,
119+
old_commit: Optional[bytes] = None, summary: str = '') -> None:
120120
""" Initialize a new instance """
121121
self.flags = flags
122122
self.local_ref = local_ref
@@ -126,11 +126,11 @@ def __init__(self, flags, local_ref, remote_ref_string, remote, old_commit=None,
126126
self.summary = summary
127127

128128
@property
129-
def old_commit(self):
129+
def old_commit(self) -> Optional[bool]:
130130
return self._old_commit_sha and self._remote.repo.commit(self._old_commit_sha) or None
131131

132132
@property
133-
def remote_ref(self):
133+
def remote_ref(self) -> Union[RemoteReference, TagReference]:
134134
"""
135135
:return:
136136
Remote Reference or TagReference in the local repository corresponding

0 commit comments

Comments
 (0)