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

Commitafd2ec5

Browse files
committed
Add type to symbolicreference.delete()
1 parenta8ee94b commitafd2ec5

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
@@ -421,7 +421,7 @@ def log_entry(self, index):
421421
returnRefLog.entry_at(RefLog.path(self),index)
422422

423423
@classmethod
424-
defto_full_path(cls,path)->PathLike:
424+
defto_full_path(cls,path:Union[PathLike,'SymbolicReference'])->PathLike:
425425
"""
426426
:return: string with a full repository-relative path which can be used to initialize
427427
a Reference instance, for instance by using ``Reference.from_path``"""
@@ -430,12 +430,12 @@ def to_full_path(cls, path) -> PathLike:
430430
full_ref_path=path
431431
ifnotcls._common_path_default:
432432
returnfull_ref_path
433-
ifnotpath.startswith(cls._common_path_default+"/"):
433+
ifnotstr(path).startswith(cls._common_path_default+"/"):
434434
full_ref_path='%s/%s'% (cls._common_path_default,path)
435435
returnfull_ref_path
436436

437437
@classmethod
438-
defdelete(cls,repo,path):
438+
defdelete(cls,repo:'Repo',path:PathLike)->None:
439439
"""Delete the reference at the given path
440440
441441
:param repo:
@@ -457,8 +457,8 @@ def delete(cls, repo, path):
457457
new_lines= []
458458
made_change=False
459459
dropped_last_line=False
460-
forlineinreader:
461-
line=line.decode(defenc)
460+
forline_bytesinreader:
461+
line=line_bytes.decode(defenc)
462462
_,_,line_ref=line.partition(' ')
463463
line_ref=line_ref.strip()
464464
# keep line if it is a comment or if the ref to delete is not

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp