diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-07-20 07:04:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 07:04:18 +0800 |
commit | cfd653aeeb3cb807f2cd2ae9fff5568880ac67da (patch) | |
tree | 8514389e82efdcdcdeaab5d3a85553883f28117c /git/objects/base.py | |
parent | acbd6bad9ded9a1d59e80e71d334d64b0244f5cd (diff) | |
parent | 600df043e76924d43a4f9f88f4e3241740f34c77 (diff) | |
download | gitpython-cfd653aeeb3cb807f2cd2ae9fff5568880ac67da.tar.gz |
Merge pull request #1295 from Yobmod/main
Add types to refs
Diffstat (limited to 'git/objects/base.py')
-rw-r--r-- | git/objects/base.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git/objects/base.py b/git/objects/base.py index 4e2ed493..64f105ca 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -15,9 +15,9 @@ from .util import get_object_type_by_name # typing ------------------------------------------------------------------ -from typing import Any, TYPE_CHECKING, Optional, Union +from typing import Any, TYPE_CHECKING, Union -from git.types import PathLike, Commit_ish +from git.types import PathLike, Commit_ish, Lit_commit_ish if TYPE_CHECKING: from git.repo import Repo @@ -44,7 +44,7 @@ class Object(LazyMixin): TYPES = (dbtyp.str_blob_type, dbtyp.str_tree_type, dbtyp.str_commit_type, dbtyp.str_tag_type) __slots__ = ("repo", "binsha", "size") - type = None # type: Optional[str] # to be set by subclass + type: Union[Lit_commit_ish, None] = None def __init__(self, repo: 'Repo', binsha: bytes): """Initialize an object by identifying it by its binary sha. |