From c2fd97e374f9c1187f165b18651928c011e6f041 Mon Sep 17 00:00:00 2001 From: Twist Date: Tue, 23 Aug 2022 19:52:11 +0100 Subject: Update regex to extract the author string, and create the Actor using the _from_string classmethod. --- git/objects/commit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git/objects/commit.py') diff --git a/git/objects/commit.py b/git/objects/commit.py index 65c94f23..58f0bde7 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -752,11 +752,11 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable): if self.message: results = re.findall( - r"^Co-authored-by: ((?:\w|\-| ){0,38}) <(\S*)>$", + r"^Co-authored-by: ((?:\w|\-| ){0,38} <\S*>)$", self.message, re.MULTILINE, ) - for author in results: - co_authors.append(Actor(*author)) + for author_string in results: + co_authors.append(Actor._from_string(author_string)) return co_authors -- cgit v1.2.1