From 8e41fb4c579c5860c97c164bbee44b1d4c8a7506 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sun, 14 Dec 2025 05:15:55 +0000 Subject: [PATCH] types: deduplicate coauthors list Signed-off-by: oppiliappan --- types/commit.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/commit.go b/types/commit.go index 30cb4523..e25f0a3a 100644 --- a/types/commit.go +++ b/types/commit.go @@ -174,7 +174,7 @@ var ( func (commit Commit) CoAuthors() []object.Signature { var coAuthors []object.Signature - + seen := make(map[string]bool) matches := coAuthorRegex.FindAllStringSubmatch(commit.Message, -1) for _, match := range matches { @@ -182,6 +182,11 @@ func (commit Commit) CoAuthors() []object.Signature { name := strings.TrimSpace(match[1]) email := strings.TrimSpace(match[2]) + if seen[email] { + continue + } + seen[email] = true + coAuthors = append(coAuthors, object.Signature{ Name: name, Email: email, -- 2.51.2