diff options
Diffstat (limited to 'git')
-rw-r--r-- | git/db/cmd/base.py | 7 | ||||
-rw-r--r-- | git/test/db/base.py | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/git/db/cmd/base.py b/git/db/cmd/base.py index 6a4a6544..5fa82dc7 100644 --- a/git/db/cmd/base.py +++ b/git/db/cmd/base.py @@ -701,6 +701,9 @@ class CmdHighLevelRepository(HighLevelRepository): if len(digits) == 3: info = {'id': firstpart} blames.append([None, []]) + elif info['id'] != firstpart: + info = {'id': firstpart} + blames.append([commits.get(firstpart), []]) # END blame data initialization else: m = self.re_author_committer_start.search(firstpart) @@ -747,8 +750,8 @@ class CmdHighLevelRepository(HighLevelRepository): m = self.re_tab_full_line.search(line) text, = m.groups() blames[-1][0] = c - blames[-1][1].append( text ) - info = None + blames[-1][1].append(text) + info = { 'id' : sha } # END if we collected commit info # END distinguish filename,summary,rest # END distinguish author|committer vs filename,summary,rest diff --git a/git/test/db/base.py b/git/test/db/base.py index 2f8f50e2..0f5eebe4 100644 --- a/git/test/db/base.py +++ b/git/test/db/base.py @@ -283,6 +283,15 @@ class RepoBase(TestDBBase): assert_true( isinstance( tlist[0], basestring ) ) assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug + def test_blame_real(self): + c = 0 + for item in self.rorepo.head.commit.tree.traverse( + predicate=lambda i, d: i.type == 'blob' and i.path.endswith('.py')): + c += 1 + b = self.rorepo.blame(self.rorepo.head, item.path) + #END for each item to traverse + assert c + def test_untracked_files(self): base = self.rorepo.working_tree_dir files = ( join_path_native(base, "__test_myfile"), |