diff options
author | Yobmod <yobmod@gmail.com> | 2021-06-30 18:41:06 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-06-30 18:41:06 +0100 |
commit | 82b131cf2afebbed3723df5b5dfd5cd820716f97 (patch) | |
tree | ef007c76db64b1f0cbfc99941a9a4de7d3fd3b8a /git/objects/base.py | |
parent | 75dbf90efb5e292bac5f54700f7f0efedf3e47d5 (diff) | |
download | gitpython-82b131cf2afebbed3723df5b5dfd5cd820716f97.tar.gz |
Type Traversable.traverse() better, start types of submodule
Diffstat (limited to 'git/objects/base.py')
-rw-r--r-- | git/objects/base.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/git/objects/base.py b/git/objects/base.py index 884f9651..6bc1945c 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -17,15 +17,12 @@ from .util import get_object_type_by_name from typing import Any, TYPE_CHECKING, Optional, Union -from git.types import PathLike +from git.types import PathLike, Commit_ish if TYPE_CHECKING: from git.repo import Repo from gitdb.base import OStream - from .tree import Tree - from .blob import Blob - from .tag import TagObject - from .commit import Commit + # from .tree import Tree, Blob, Commit, TagObject # -------------------------------------------------------------------------- @@ -71,7 +68,7 @@ class Object(LazyMixin): return repo.rev_parse(str(id)) @classmethod - def new_from_sha(cls, repo: 'Repo', sha1: bytes) -> Union['Commit', 'TagObject', 'Tree', 'Blob']: + def new_from_sha(cls, repo: 'Repo', sha1: bytes) -> Commit_ish: """ :return: new object instance of a type appropriate to represent the given binary sha1 |