GeezerVison is showing github.com — Merge pull request #1119 from yvolchkov/master · gitpython-developers/GitPython@9de6450
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: git/objects/commit.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -269,7 +269,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream): |
269 | 269 | # END handle extra info |
270 | 270 |
|
271 | 271 | assert len(hexsha) == 40, "Invalid line: %s" % hexsha |
272 | | - yield Commit(repo, hex_to_bin(hexsha)) |
| 272 | + yield cls(repo, hex_to_bin(hexsha)) |
273 | 273 | # END for each line in stream |
274 | 274 | # TODO: Review this - it seems process handling got a bit out of control |
275 | 275 | # due to many developers trying to fix the open file handles issue |
|
Collapse file
Copy file name to clipboardExpand all lines: test/test_commit.py +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -199,6 +199,13 @@ def test_iteration(self): |
199 | 199 | less_ltd_commits = list(Commit.iter_items(self.rorepo, 'master', paths=('CHANGES', 'AUTHORS'))) |
200 | 200 | assert len(ltd_commits) < len(less_ltd_commits) |
201 | 201 |
|
| 202 | + class Child(Commit): |
| 203 | + def __init__(self, *args, **kwargs): |
| 204 | + super(Child, self).__init__(*args, **kwargs) |
| 205 | + |
| 206 | + child_commits = list(Child.iter_items(self.rorepo, 'master', paths=('CHANGES', 'AUTHORS'))) |
| 207 | + assert type(child_commits[0]) == Child |
| 208 | + |
202 | 209 | def test_iter_items(self): |
203 | 210 | # pretty not allowed |
204 | 211 | self.assertRaises(ValueError, Commit.iter_items, self.rorepo, 'master', pretty="raw") |
|