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/cmd.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/cmd.py')
-rw-r--r-- | git/cmd.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -615,7 +615,7 @@ class Git(LazyMixin): # END handle version info @property - def working_dir(self) -> Union[None, str]: + def working_dir(self) -> Union[None, PathLike]: """:return: Git directory we are working on""" return self._working_dir @@ -1187,7 +1187,7 @@ class Git(LazyMixin): cmd.stdin.flush() return self._parse_object_header(cmd.stdout.readline()) - def get_object_header(self, ref: AnyStr) -> Tuple[str, str, int]: + def get_object_header(self, ref: str) -> Tuple[str, str, int]: """ Use this method to quickly examine the type and size of the object behind the given ref. @@ -1198,7 +1198,7 @@ class Git(LazyMixin): cmd = self._get_persistent_cmd("cat_file_header", "cat_file", batch_check=True) return self.__get_object_header(cmd, ref) - def get_object_data(self, ref: AnyStr) -> Tuple[str, str, int, bytes]: + def get_object_data(self, ref: str) -> Tuple[str, str, int, bytes]: """ As get_object_header, but returns object data as well :return: (hexsha, type_string, size_as_int,data_string) :note: not threadsafe""" @@ -1207,7 +1207,7 @@ class Git(LazyMixin): del(stream) return (hexsha, typename, size, data) - def stream_object_data(self, ref: AnyStr) -> Tuple[str, str, int, 'Git.CatFileContentStream']: + def stream_object_data(self, ref: str) -> Tuple[str, str, int, 'Git.CatFileContentStream']: """ As get_object_header, but returns the data as a stream :return: (hexsha, type_string, size_as_int, stream) |