From 62f78814206a99fafeedab1d4f2ee6f4c6b70ef1 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Sat, 31 Jul 2021 17:59:14 +0100 Subject: Add type to repo.base._to_full_tag_path --- git/repo/base.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'git/repo/base.py') diff --git a/git/repo/base.py b/git/repo/base.py index 355f9399..5581233b 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -412,13 +412,14 @@ class Repo(object): return TagReference(self, full_path) @staticmethod - def _to_full_tag_path(path): - if path.startswith(TagReference._common_path_default + '/'): - return path - if path.startswith(TagReference._common_default + '/'): - return Reference._common_path_default + '/' + path + def _to_full_tag_path(path: PathLike) -> str: + path_str = str(path) + if path_str.startswith(TagReference._common_path_default + '/'): + return path_str + if path_str.startswith(TagReference._common_default + '/'): + return Reference._common_path_default + '/' + path_str else: - return TagReference._common_path_default + '/' + path + return TagReference._common_path_default + '/' + path_str def create_head(self, path: PathLike, commit: str = 'HEAD', force: bool = False, logmsg: Optional[str] = None -- cgit v1.2.1