diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-07-20 07:04:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 07:04:18 +0800 |
commit | cfd653aeeb3cb807f2cd2ae9fff5568880ac67da (patch) | |
tree | 8514389e82efdcdcdeaab5d3a85553883f28117c /git/diff.py | |
parent | acbd6bad9ded9a1d59e80e71d334d64b0244f5cd (diff) | |
parent | 600df043e76924d43a4f9f88f4e3241740f34c77 (diff) | |
download | gitpython-cfd653aeeb3cb807f2cd2ae9fff5568880ac67da.tar.gz |
Merge pull request #1295 from Yobmod/main
Add types to refs
Diffstat (limited to 'git/diff.py')
-rw-r--r-- | git/diff.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/diff.py b/git/diff.py index 51dac390..98a5cfd9 100644 --- a/git/diff.py +++ b/git/diff.py @@ -143,7 +143,7 @@ class Diffable(object): paths = [paths] if hasattr(self, 'Has_Repo'): - self.repo: Repo = self.repo + self.repo: 'Repo' = self.repo diff_cmd = self.repo.git.diff if other is self.Index: @@ -351,13 +351,13 @@ class Diff(object): return hash(tuple(getattr(self, n) for n in self.__slots__)) def __str__(self) -> str: - h = "%s" # type: str + h: str = "%s" if self.a_blob: h %= self.a_blob.path elif self.b_blob: h %= self.b_blob.path - msg = '' # type: str + msg: str = '' line = None # temp line line_length = 0 # line length for b, n in zip((self.a_blob, self.b_blob), ('lhs', 'rhs')): @@ -449,7 +449,7 @@ class Diff(object): :return: git.DiffIndex """ ## FIXME: Here SLURPING raw, need to re-phrase header-regexes linewise. - text_list = [] # type: List[bytes] + text_list: List[bytes] = [] handle_process_output(proc, text_list.append, None, finalize_process, decode_streams=False) # for now, we have to bake the stream |