From af86f05d11c3613a418f7d3babfdc618e1cac805 Mon Sep 17 00:00:00 2001 From: Yuri Volchkov Date: Fri, 5 Feb 2021 11:22:54 +0100 Subject: Fix inheritance issue at commit.iter_items The iterator used to yield Commit() objects, which does not play well with inheritance. Yield cls() instead. Signed-off-by: Yuri Volchkov --- git/objects/commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/objects/commit.py') diff --git a/git/objects/commit.py b/git/objects/commit.py index 8a84dd69..302798cb 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -269,7 +269,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): # END handle extra info assert len(hexsha) == 40, "Invalid line: %s" % hexsha - yield Commit(repo, hex_to_bin(hexsha)) + yield cls(repo, hex_to_bin(hexsha)) # END for each line in stream # TODO: Review this - it seems process handling got a bit out of control # due to many developers trying to fix the open file handles issue -- cgit v1.2.1