@@ -146,13 +146,13 @@ def dereference_recursive(cls, repo: 'Repo', ref_path: PathLike) -> str:
146
146
intermediate references as required
147
147
:param repo: the repository containing the reference at ref_path"""
148
148
while True :
149
- hexsha , ref_path = cls ._get_ref_info (repo , ref_path )
149
+ hexsha , ref_path = cls ._get_ref_info (repo , ref_path ) # type: ignore
150
150
if hexsha is not None :
151
151
return hexsha
152
152
# END recursive dereferencing
153
153
154
154
@classmethod
155
- def _get_ref_info_helper (cls , repo : 'Repo' , ref_path : PathLike ):
155
+ def _get_ref_info_helper (cls , repo : 'Repo' , ref_path : PathLike ) -> Union [ Tuple [ str , None ], Tuple [ None , str ]] :
156
156
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at
157
157
rela_path points to, or None. target_ref_path is the reference we
158
158
point to, or None"""
@@ -191,13 +191,13 @@ def _get_ref_info_helper(cls, repo: 'Repo', ref_path: PathLike):
191
191
raise ValueError ("Failed to parse reference information from %r" % ref_path )
192
192
193
193
@classmethod
194
- def _get_ref_info (cls , repo , ref_path ) :
194
+ def _get_ref_info (cls , repo : 'Repo' , ref_path : PathLike ) -> Union [ Tuple [ str , None ], Tuple [ None , str ]] :
195
195
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at
196
196
rela_path points to, or None. target_ref_path is the reference we
197
197
point to, or None"""
198
198
return cls ._get_ref_info_helper (repo , ref_path )
199
199
200
- def _get_object (self ):
200
+ def _get_object (self ) -> Commit_ish :
201
201
"""
202
202
:return:
203
203
The object our ref currently refers to. Refs can be cached, they will
@@ -206,7 +206,7 @@ def _get_object(self):
206
206
# Our path will be resolved to the hexsha which will be used accordingly
207
207
return Object .new_from_sha (self .repo , hex_to_bin (self .dereference_recursive (self .repo , self .path )))
208
208
209
- def _get_commit (self ):
209
+ def _get_commit (self ) -> 'Commit' :
210
210
"""
211
211
:return:
212
212
Commit object we point to, works for detached and non-detached
0 commit comments