diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-31 17:59:14 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-31 17:59:14 +0100 |
commit | 62f78814206a99fafeedab1d4f2ee6f4c6b70ef1 (patch) | |
tree | 351e750c572c7a183c513396395f9a04236d67db /git/repo/base.py | |
parent | 3be955e5adc09d20a7e2e919ee1e95a7a0f5fb0e (diff) | |
download | gitpython-62f78814206a99fafeedab1d4f2ee6f4c6b70ef1.tar.gz |
Add type to repo.base._to_full_tag_path
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 13 |
1 files changed, 7 insertions, 6 deletions
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 |