diff options
author | Yobmod <yobmod@gmail.com> | 2021-08-02 22:50:11 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-08-02 22:50:11 +0100 |
commit | 1aaa7048ddecb4509e1c279e28de5ef71477e71f (patch) | |
tree | 52fa4d63850adf50257ccbbd69d83138f917d41d /git/repo/base.py | |
parent | e4761ff67ef14df27026bbe9e215b9ddf5e5b3a5 (diff) | |
download | gitpython-1aaa7048ddecb4509e1c279e28de5ef71477e71f.tar.gz |
Test Dataclass in repo.base.blame() 4
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index 58b9d5c2..2bfc4677 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -985,22 +985,21 @@ class Repo(object): commits[sha] = c blames[-1][0] = c # END if commit objects needs initial creation - if not is_binary: - if line_str and line_str[0] == '\t': - line_str = line_str[1:] - else: - pass - # 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. if blames[-1][1] is not None: - blames[-1][1].append(line_str) + if not is_binary: + if line_str and line_str[0] == '\t': + line_str = line_str[1:] + blames[-1][1].append(line_str) + else: + blames[-1][1].append(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. info = {'id': sha} # end handle line contents - info = {'id': sha} # END if we collected commit info # END distinguish filename,summary,rest # END distinguish author|committer vs filename,summary,rest |