diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-05-18 08:29:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 08:29:52 +0800 |
commit | b11bcfa3df4d0b792823930bffae126fd12673f7 (patch) | |
tree | 85dc837ef6cadec84d232f5e7110d2dfc44c3b1a /git/db.py | |
parent | 33346b25c3a4fb5ea37202d88d6a6c66379099c5 (diff) | |
parent | c30bf3ba7548a0e996907b9a097ec322760eb43a (diff) | |
download | gitpython-b11bcfa3df4d0b792823930bffae126fd12673f7.tar.gz |
Merge pull request #1244 from Yobmod/main
Added types to Index submodule
Diffstat (limited to 'git/db.py')
-rw-r--r-- | git/db.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -12,7 +12,7 @@ from git.exc import GitCommandError # typing------------------------------------------------- -from typing import TYPE_CHECKING, AnyStr +from typing import TYPE_CHECKING from git.types import PathLike if TYPE_CHECKING: @@ -39,18 +39,18 @@ class GitCmdObjectDB(LooseObjectDB): super(GitCmdObjectDB, self).__init__(root_path) self._git = git - def info(self, sha: bytes) -> OInfo: - hexsha, typename, size = self._git.get_object_header(bin_to_hex(sha)) + def info(self, binsha: bytes) -> OInfo: + hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha)) return OInfo(hex_to_bin(hexsha), typename, size) - def stream(self, sha: bytes) -> OStream: + def stream(self, binsha: bytes) -> OStream: """For now, all lookup is done by git itself""" - hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(sha)) + hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(binsha)) return OStream(hex_to_bin(hexsha), typename, size, stream) # { Interface - def partial_to_complete_sha_hex(self, partial_hexsha: AnyStr) -> bytes: + def partial_to_complete_sha_hex(self, partial_hexsha: str) -> bytes: """:return: Full binary 20 byte sha from the given partial hexsha :raise AmbiguousObjectName: :raise BadObject: |