From 6609ef7c3b5bb840dba8d0a5362e67746761a437 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 19 Jul 2021 16:57:04 +0100 Subject: Make types in refs compatible with objects --- git/objects/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git/objects/base.py') 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. -- cgit v1.2.1