@@ -131,9 +131,10 @@ class PushInfo(object):
131
131
'=' : UP_TO_DATE ,
132
132
'!' : ERROR }
133
133
134
- def __init__ (self , flags : int , local_ref : SymbolicReference , remote_ref_string : str , remote ,
135
- old_commit : Optional [bytes ] = None , summary : str = '' ) -> None :
136
- """ Initialize a new instance """
134
+ def __init__ (self , flags : int , local_ref : Union [SymbolicReference , None ], remote_ref_string : str , remote ,
135
+ old_commit : Optional [str ] = None , summary : str = '' ) -> None :
136
+ """ Initialize a new instance
137
+ local_ref: HEAD | Head | RemoteReference | TagReference | Reference | SymbolicReference | None """
137
138
self .flags = flags
138
139
self .local_ref = local_ref
139
140
self .remote_ref_string = remote_ref_string
@@ -162,7 +163,7 @@ def remote_ref(self) -> Union[RemoteReference, TagReference]:
162
163
# END
163
164
164
165
@classmethod
165
- def _from_line (cls , remote , line ) :
166
+ def _from_line (cls , remote , line : str ) -> 'PushInfo' :
166
167
"""Create a new PushInfo instance as parsed from line which is expected to be like
167
168
refs/heads/master:refs/heads/master 05d2687..1d0568e as bytes"""
168
169
control_character , from_to , summary = line .split ('\t ' , 3 )
@@ -178,15 +179,15 @@ def _from_line(cls, remote, line):
178
179
# from_to handling
179
180
from_ref_string , to_ref_string = from_to .split (':' )
180
181
if flags & cls .DELETED :
181
- from_ref = None
182
+ from_ref = None # type: Union[SymbolicReference, None]
182
183
else :
183
184
if from_ref_string == "(delete)" :
184
185
from_ref = None
185
186
else :
186
187
from_ref = Reference .from_path (remote .repo , from_ref_string )
187
188
188
189
# commit handling, could be message or commit info
189
- old_commit = None
190
+ old_commit = None # type: Optional[str]
190
191
if summary .startswith ('[' ):
191
192
if "[rejected]" in summary :
192
193
flags |= cls .REJECTED
0 commit comments