| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,9 @@ Commit | |||
| 24 | 24 | the first line) and a new property ``Commit.summary`` contains the first | |
| 25 | 25 | line of the commit message. | |
| 26 | 26 | ||
| 27 | + * Fixed a failure when trying to lookup the stats of a parentless commit from | ||
| 28 | + a bare repo. | ||
| 29 | + | ||
| 27 | 30 | Diff | |
| 28 | 31 | ---- | |
| 29 | 32 | * The diff parser is now far faster and also addresses a bug where | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -165,7 +165,7 @@ def list_from_string(cls, repo, text): | |||
| 165 | 165 | ||
| 166 | 166 | message = '\n'.join(messages) | |
| 167 | 167 | ||
| 168 | - commits.append(Commit(repo, id=id, parents=parents, tree=tree, author=author, authored_date=authored_date, | ||
| 168 | + commits.append(Commit(repo, id=id, parents=parents, tree=tree, author=author, authored_date=authored_date, | ||
| 169 | 169 | committer=committer, committed_date=committed_date, message=message)) | |
| 170 | 170 | ||
| 171 | 171 | return commits | |
@@ -224,11 +224,11 @@ def diffs(self): | |||
| 224 | 224 | @property | |
| 225 | 225 | def stats(self): | |
| 226 | 226 | if not self.parents: | |
| 227 | - text = self.repo.git.diff(self.id, '--', numstat=True) | ||
| 227 | + text = self.repo.git.diff_tree(self.id, '--', numstat=True, root=True) | ||
| 228 | 228 | text2 = "" | |
| 229 | - for line in text.splitlines(): | ||
| 229 | + for line in text.splitlines()[1:]: | ||
| 230 | 230 | (insertions, deletions, filename) = line.split("\t") | |
| 231 | - text2 += "%s\t%s\t%s\n" % (deletions, insertions, filename) | ||
| 231 | + text2 += "%s\t%s\t%s\n" % (insertions, deletions, filename) | ||
| 232 | 232 | text = text2 | |
| 233 | 233 | else: | |
| 234 | 234 | text = self.repo.git.diff(self.parents[0].id, self.id, '--', numstat=True) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + 634396b2f541a9f2d58b00be1a07f0c358b999b3 | ||
| 2 | + 18 29 a.txt | ||
| 3 | + 5 0 b.txt | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,7 +129,7 @@ def test_diffs(self, git): | |||
| 129 | 129 | assert_equal(True, diffs[5].new_file) | |
| 130 | 130 | ||
| 131 | 131 | assert_true(git.called) | |
| 132 | - assert_equal(git.call_args, (('diff', '-M', | ||
| 132 | + assert_equal(git.call_args, (('diff', '-M', | ||
| 133 | 133 | '038af8c329ef7c1bae4568b98bd5c58510465493', | |
| 134 | 134 | '91169e1f5fa4de2eaea3f176461f5dc784796769', | |
| 135 | 135 | ), {'full_index': True})) | |
@@ -190,7 +190,7 @@ def test_diffs_with_mode_only_change(self, git): | |||
| 190 | 190 | ||
| 191 | 191 | @patch_object(Git, '_call_process') | |
| 192 | 192 | def test_stats(self, git): | |
| 193 | - git.return_value = fixture('diff_numstat') | ||
| 193 | + git.return_value = fixture('diff_tree_numstat_root') | ||
| 194 | 194 | ||
| 195 | 195 | commit = Commit(self.repo, id='634396b2f541a9f2d58b00be1a07f0c358b999b3') | |
| 196 | 196 | commit.__bake_it__() | |
@@ -201,7 +201,7 @@ def test_stats(self, git): | |||
| 201 | 201 | assert_equal(["a.txt", "b.txt"], keys) | |
| 202 | 202 | ||
| 203 | 203 | assert_true(git.called) | |
| 204 | - assert_equal(git.call_args, (('diff', '634396b2f541a9f2d58b00be1a07f0c358b999b3', '--'), {'numstat': True})) | ||
| 204 | + assert_equal(git.call_args, (('diff_tree', '634396b2f541a9f2d58b00be1a07f0c358b999b3', '--'), {'numstat': True, 'root': True })) | ||
| 205 | 205 | ||
| 206 | 206 | @patch_object(Git, '_call_process') | |
| 207 | 207 | def test_rev_list_bisect_all(self, git): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments