Skip to content

Commit c2fd97e

Browse files
committed
Update regex to extract the author string, and create the Actor using the _from_string classmethod.
1 parent 3cb7ecf commit c2fd97e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git/objects/commit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,11 @@ def co_authors(self) -> List[Actor]:
752752

753753
if self.message:
754754
results = re.findall(
755-
r"^Co-authored-by: ((?:\w|\-| ){0,38}) <(\S*)>$",
755+
r"^Co-authored-by: ((?:\w|\-| ){0,38} <\S*>)$",
756756
self.message,
757757
re.MULTILINE,
758758
)
759-
for author in results:
760-
co_authors.append(Actor(*author))
759+
for author_string in results:
760+
co_authors.append(Actor._from_string(author_string))
761761

762762
return co_authors

0 commit comments

Comments
 (0)