Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33401c3

Browse files
committed
Fixed git.blob.Blob.blame function which would return the text-per-commit as individual characters
1 parent4c39f9d commit33401c3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎lib/git/blob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def blame(cls, repo, commit, file):
135135
m=re.search(r'^\t(.*)$',line)
136136
text,=m.groups()
137137
blames[-1][0]=c
138-
blames[-1][1]+=text
138+
blames[-1][1].append(text )
139139
info=None
140140

141141
returnblames

‎test/git/test_blob.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_should_display_blame_information(self, git):
6969
git.return_value=fixture('blame')
7070
b=Blob.blame(self.repo,'master','lib/git.py')
7171
assert_equal(13,len(b))
72+
assert_equal(2,len(b[0]) )
7273
# assert_equal(25, reduce(lambda acc, x: acc + len(x[-1]), b))
7374
assert_equal(hash(b[0][0]),hash(b[9][0]))
7475
c=b[0][0]
@@ -83,6 +84,13 @@ def test_should_display_blame_information(self, git):
8384
assert_equal('tom@mojombo.com',c.committer.email)
8485
assert_equal(time.gmtime(1191997100),c.committed_date)
8586
assert_equal('initial grit setup',c.message)
87+
88+
# test the 'lines per commit' entries
89+
tlist=b[0][1]
90+
assert_true(tlist )
91+
assert_true(isinstance(tlist[0],basestring ) )
92+
assert_true(len(tlist )<sum(len(t)fortintlist ) )# test for single-char bug
93+
8694

8795
deftest_should_return_appropriate_representation(self):
8896
blob=Blob(self.repo,**{'id':'abc'})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp