Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c2454d

Browse files
committed
Add final types to symbolic.py
1 parent48f64bb commit3c2454d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎git/refs/symbolic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ def dereference_recursive(cls, repo: 'Repo', ref_path: PathLike) -> str:
146146
intermediate references as required
147147
:param repo: the repository containing the reference at ref_path"""
148148
whileTrue:
149-
hexsha,ref_path=cls._get_ref_info(repo,ref_path)
149+
hexsha,ref_path=cls._get_ref_info(repo,ref_path)# type: ignore
150150
ifhexshaisnotNone:
151151
returnhexsha
152152
# END recursive dereferencing
153153

154154
@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]]:
156156
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at
157157
rela_path points to, or None. target_ref_path is the reference we
158158
point to, or None"""
@@ -191,13 +191,13 @@ def _get_ref_info_helper(cls, repo: 'Repo', ref_path: PathLike):
191191
raiseValueError("Failed to parse reference information from %r"%ref_path)
192192

193193
@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]]:
195195
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at
196196
rela_path points to, or None. target_ref_path is the reference we
197197
point to, or None"""
198198
returncls._get_ref_info_helper(repo,ref_path)
199199

200-
def_get_object(self):
200+
def_get_object(self)->Commit_ish:
201201
"""
202202
:return:
203203
The object our ref currently refers to. Refs can be cached, they will
@@ -206,7 +206,7 @@ def _get_object(self):
206206
# Our path will be resolved to the hexsha which will be used accordingly
207207
returnObject.new_from_sha(self.repo,hex_to_bin(self.dereference_recursive(self.repo,self.path)))
208208

209-
def_get_commit(self):
209+
def_get_commit(self)->'Commit':
210210
"""
211211
:return:
212212
Commit object we point to, works for detached and non-detached

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp