diff options
author | yobmod <yobmod@gmail.com> | 2021-05-03 15:59:07 +0100 |
---|---|---|
committer | yobmod <yobmod@gmail.com> | 2021-05-03 15:59:07 +0100 |
commit | 6752fad0e93d1d2747f56be30a52fea212bd15d6 (patch) | |
tree | a0618d53d06f35d7326fcacdcaf1832d7ab55b8c /git/db.py | |
parent | 2fd9f6ee5c8b4ae4e01a40dc398e2768d838210d (diff) | |
download | gitpython-6752fad0e93d1d2747f56be30a52fea212bd15d6.tar.gz |
add initial types to remote.py
Diffstat (limited to 'git/db.py')
-rw-r--r-- | git/db.py | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,5 +1,4 @@ """Module with our own gitdb implementation - it uses the git command""" -from typing import AnyStr from git.util import bin_to_hex, hex_to_bin from gitdb.base import ( OInfo, @@ -7,21 +6,23 @@ from gitdb.base import ( ) from gitdb.db import GitDB # @UnusedImport from gitdb.db import LooseObjectDB -from gitdb.exc import BadObject -from .exc import GitCommandError +from gitdb.exc import BadObject +from git.exc import GitCommandError # typing------------------------------------------------- -from .cmd import Git -from .types import PathLike +from typing import TYPE_CHECKING, AnyStr +from git.types import PathLike + +if TYPE_CHECKING: + from git.cmd import Git + # -------------------------------------------------------- __all__ = ('GitCmdObjectDB', 'GitDB') -# class GitCmdObjectDB(CompoundDB, ObjectDBW): - class GitCmdObjectDB(LooseObjectDB): @@ -33,7 +34,7 @@ class GitCmdObjectDB(LooseObjectDB): have packs and the other implementations """ - def __init__(self, root_path: PathLike, git: Git) -> None: + def __init__(self, root_path: PathLike, git: 'Git') -> None: """Initialize this instance with the root and a git command""" super(GitCmdObjectDB, self).__init__(root_path) self._git = git |