diff options
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index a9d2e5be..0f231e5f 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -890,7 +890,7 @@ class Repo(object): commits: Dict[str, Commit] = {} blames: List[List[Commit | List[str | bytes] | None]] = [] - class InfoTC(TypedDict, total=False): + class InfoTD(TypedDict, total=False): sha: str id: str filename: str @@ -992,19 +992,20 @@ class Repo(object): commits[sha] = c blames[-1][0] = c # END if commit objects needs initial creation - if blames[-1][1] is not None: - if not is_binary: - if line_str and line_str[0] == '\t': - line_str = line_str[1:] - - blames[-1][1].append(line_str) - else: - # NOTE: We are actually parsing lines out of binary data, which can lead to the - # binary being split up along the newline separator. We will append this to the - # blame we are currently looking at, even though it should be concatenated with - # the last line we have seen. - blames[-1][1].append(line_bytes) + if not is_binary: + if line_str and line_str[0] == '\t': + line_str = line_str[1:] + line_AnyStr: str | bytes = line_str + else: + line_AnyStr = line_bytes + # NOTE: We are actually parsing lines out of binary data, which can lead to the + # binary being split up along the newline separator. We will append this to the + # blame we are currently looking at, even though it should be concatenated with + # the last line we have seen. + # end handle line contents + if blames[-1][1] is not None: + blames[-1][1].append(line_AnyStr) info.id = sha # END if we collected commit info |