summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-31 17:59:14 +0100
committerYobmod <yobmod@gmail.com>2021-07-31 17:59:14 +0100
commit62f78814206a99fafeedab1d4f2ee6f4c6b70ef1 (patch)
tree351e750c572c7a183c513396395f9a04236d67db
parent3be955e5adc09d20a7e2e919ee1e95a7a0f5fb0e (diff)
downloadgitpython-62f78814206a99fafeedab1d4f2ee6f4c6b70ef1.tar.gz
Add type to repo.base._to_full_tag_path
-rw-r--r--git/repo/base.py13
-rw-r--r--pyproject.toml2
2 files changed, 8 insertions, 7 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
diff --git a/pyproject.toml b/pyproject.toml
index 6437a719..4751ffcb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -19,7 +19,7 @@ filterwarnings = 'ignore::DeprecationWarning'
# filterwarnings ignore::WarningType # ignores those warnings
[tool.mypy]
-# disallow_untyped_defs = true
+disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
# warn_unused_ignores = True