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

Commitabf9373

Browse files
committed
Fixes resolving of tag parameter for repo.tag
I accessed private variables instead of adding getters,because other parts of the code do the same and I didn'tknow if there was a reason for it.E.g.: remote.py line 409:(...) RemoteReference._common_path_default (...)
1 parent057514e commitabf9373

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎git/repo/base.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,18 @@ def tags(self) -> 'IterableList':
402402
deftag(self,path:PathLike)->TagReference:
403403
""":return: TagReference Object, reference pointing to a Commit or Tag
404404
:param path: path to the tag reference, i.e. 0.1.5 or tags/0.1.5 """
405-
returnTagReference(self,path)
405+
full_path=self._to_full_tag_path(path)
406+
returnTagReference(self,full_path)
407+
408+
@staticmethod
409+
def_to_full_tag_path(path:PathLike):
410+
ifpath.startswith(TagReference._common_path_default+'/'):
411+
returnpath
412+
ifpath.startswith(TagReference._common_default+'/'):
413+
returnReference._common_path_default+'/'+path
414+
else:
415+
returnTagReference._common_path_default+'/'+path
416+
406417

407418
defcreate_head(self,path:PathLike,commit:str='HEAD',
408419
force:bool=False,logmsg:Optional[str]=None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp